Did I find the right examples for you? yes no

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)

        def parseopts(args):
    parser = create_main_parser()
    parser.main = True # so the help formatter knows

    # create command listing
    command_summaries = get_summaries()

    description = [''] + ['%-27s %s' % (i, j) for i, j in command_summaries]
    parser.description = '\n'.join(description)

    options, args = parser.parse_args(args)

    if options.version:
        sys.stdout.write(parser.version)
        sys.stdout.write(os.linesep)
        sys.exit()

    # pip || pip help || pip --help -> print_help()
    if not args or (args[0] == 'help' and len(args) == 1):
        parser.print_help()
        sys.exit()

    if not args:
        msg = ('You must give a command '
               '(use "pip --help" to see a list of commands)')
        raise CommandError(msg)

    command = args[0].lower()

    if command not in commands:
        guess = get_similar_commands(command)

        msg = ['unknown command "%s"' % command]
        if guess:
            msg.append('maybe you meant "%s"' % guess)

        raise CommandError(' - '.join(msg))

    return command, options, args, parser
        


src/p/i/pip-accel-0.12/pip_accel/__init__.py   pip-accel(Download)
from humanfriendly import Timer
from pip import index as pip_index_module
from pip import parseopts
from pip.cmdoptions import requirements as requirements_option
from pip.commands import install as pip_install_module
    # XXX Nasty hack required for pip 1.4 compatibility (workaround for global state).
    requirements_option.default = []
    cmd_name, options, args, parser = parseopts(command_line[1:])
    pip = CustomInstallCommand(parser)
    exit_status = pip.main(args[1:], options)

src/p/i/pip-accel-HEAD/pip_accel/__init__.py   pip-accel(Download)
from humanfriendly import Timer
from pip import index as pip_index_module
from pip import parseopts
from pip.cmdoptions import requirements as requirements_option
from pip.commands import install as pip_install_module
    # XXX Nasty hack required for pip 1.4 compatibility (workaround for global state).
    requirements_option.default = []
    cmd_name, options, args, parser = parseopts(command_line[1:])
    pip = CustomInstallCommand(parser)
    exit_status = pip.main(args[1:], options)

src/d/j/django-sae-0.1.27/django_sae/management/commands/upgrade_requirements.py   django-sae(Download)
        initial_args = ['install', '--upgrade', '--no-deps']
        [initial_args.extend(['--requirement', os.path.join(settings.BASE_DIR, req)]) for req in req_files]
        cmd_name, args = pip.parseopts(initial_args)
 
        InstallCommand().main(args)