a Re6 @sdZddlZddlZddlmZmZddlmZddlm Z m Z ddl m Z m Z ddlmZddlmZmZd d gZe d d d Zeeeeeefd dd ZdS)z=A single place for constructing and exposing the main parser N)ListTuple) cmdoptions)ConfigOptionParserUpdatingDefaultsHelpFormatter) commands_dictget_similar_commands) CommandError)get_pip_versionget_progcreate_main_parser parse_command)returncCsltddtdtd}|t|_ttj|}| |d|_ dgddt D}d ||_|S) z1Creates and returns the main parser for pip's CLIz %prog [options]Fglobal)usageadd_help_option formatternameprogTcSs"g|]\}}|dd|jqS)27 )summary).0r command_infor/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py 'sz&create_main_parser.. )rrr disable_interspersed_argsr versionrmake_option_group general_groupadd_option_groupmainritemsjoin description)parsergen_optsr'rrrr s"   )argsrcCst}||\}}|jr>tj|jtjtjt|rZ|ddkrjt |dkrj| t|d}|t vrt |}d|dg}|r| d|dtd||dd}||||fS)Nrhelpzunknown command ""zmaybe you meant "z - )r parse_argsr sysstdoutwriteoslinesepexitlen print_helprrappendr r&remove)r*r(general_options args_elsecmd_nameguessmsgcmd_argsrrrr 0s&   )__doc__r2r/typingrrZpip._internal.clirpip._internal.cli.parserrrpip._internal.commandsrrpip._internal.exceptionsr pip._internal.utils.miscr r __all__r strr rrrrs