def parse_command_line(self, argv=None):
        argv = sys.argv[1:] if argv is None else argv

        if self.subcommands and len(argv) > 0:
            # we have subcommands, and one may have been specified
            subc, subargv = argv[0], argv[1:]
            if re.match(r'^\w(\-?\w)*$', subc) and subc in self.subcommands:
                # it's a subcommand, and *not* a flag or class parameter
                return self.initialize_subcommand(subc, subargv)
            
        if '-h' in argv or '--help' in argv or '--help-all' in argv:
            self.print_description()
            self.print_help('--help-all' in argv)
            self.print_examples()
            self.exit(0)

        if '--version' in argv:
            self.print_version()
            self.exit(0)
        
        loader = KeyValueConfigLoader(argv=argv, aliases=self.aliases,
                                        flags=self.flags)
        try:
            config = loader.load_config()
            self.update_config(config)
        except (TraitError, ArgumentError) as e:
            self.print_description()
            self.print_help()
            self.print_examples()
            self.log.fatal(str(e))
            self.exit(1)
        # store unparsed args in extra_args
        self.extra_args = loader.extra_args
Parse the command line arguments.
dataset/ETHPy150Open ipython/ipython-py3k/IPython/config/application.py/Application.parse_command_line