()
return parser
Creates and returns the main parser for pip's CLI
Creates and returns the main parser for pip's CLI
Creates and returns the main parser for pip s CLI
def create_main_parser():
    # type: () -> ConfigOptionParser
    """Creates and returns the main parser for pip's CLI
    """

    parser_kw = {
        'usage': '\n%prog <command> [options]',
        'add_help_option': False,
        'formatter': UpdatingDefaultsHelpFormatter(),
        'name': 'global',
        'prog': get_prog(),
    }

    parser = ConfigOptionParser(**parser_kw)
    parser.disable_interspersed_args()

    parser.version = get_pip_version()

    # add the general options
    gen_opts = cmdoptions.make_option_group(cmdoptions.general_group, parser)
    parser.add_option_group(gen_opts)

    # so the help formatter knows
    parser.main = True  # type: ignore

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

    return parser
def create_main_parser ( ) : # type: () -> ConfigOptionParser parser_kw = { 'usage' : '\n%prog <command> [options]' , 'add_help_option' : False , 'formatter' : UpdatingDefaultsHelpFormatter ( ) , 'name' : 'global' , 'prog' : get_prog ( ) , } parser = ConfigOptionParser ( * * parser_kw ) parser . disable_interspersed_args ( ) parser . version = get_pip_version ( ) # add the general options gen_opts = cmdoptions . make_option_group ( cmdoptions . general_group , parser ) parser . add_option_group ( gen_opts ) # so the help formatter knows parser . main = True # type: ignore # create command listing for description command_summaries = get_summaries ( ) description = [ '' ] + [ '%-27s %s' % ( i , j ) for i , j in command_summaries ] parser . description = '\n' . join ( description ) return parser