def main(initial_args=None):
    if initial_args is None:
        initial_args = sys.argv[1:]
    autocomplete()
    options, args = parser.parse_args(initial_args)
    if options.help and not args:
        args = ['help']
    if not args:
        parser.error('You must give a command '
            '(use "%s help" to see a list of commands)' % get_prog())
    command = args[0].lower()
    load_command(command)
    if command not in command_dict:
        close_commands = difflib.get_close_matches(command, command_names())
        if close_commands:
            guess = close_commands[0]
            if args[1:]:
                guess = "%s %s" % (guess, " ".join(args[1:]))
        else:
            guess = 'install %s' % command
        error_dict = {'arg': command, 'guess': guess,
                      'script': os.path.basename(sys.argv[0])}
        parser.error('No command by the name %(script)s %(arg)s\n  '
                     '(maybe you meant "%(script)s %(guess)s")' % error_dict)
    command = command_dict[command]
    return command.main(args[1:], options)
dataset/ETHPy150Open cloudaice/simple-data/misc/virtenv/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/__init__.py/main/original