U ÀÒ.e ã@s˜dZddlZddlZddlmZddlmZmZddlm Z m Z ddl m Z ddl mZmZddlmZer|dd lmZmZd d gZd d „Zd d „ZdS)z=A single place for constructing and exposing the main parser éN)Ú cmdoptions)ÚConfigOptionParserÚUpdatingDefaultsHelpFormatter)Ú commands_dictÚget_similar_commands)Ú CommandError)Úget_pip_versionÚget_prog)ÚMYPY_CHECK_RUNNING)ÚTupleÚListÚcreate_main_parserÚ parse_commandcCstddtƒdtƒdœ}tf|Ž}| ¡tƒ|_t tj|¡}|  |¡d|_ dgdd„t   ¡Dƒ}d   |¡|_|S) z6Creates and returns the main parser for pip's CLI z %prog [options]FÚglobal)ZusageZadd_help_optionZ formatterÚnameÚprogTÚcSsg|]\}}d||jf‘qS)z%-27s %s)Zsummary)Ú.0rZ command_info©rúA/usr/lib/python3.8/site-packages/pip/_internal/cli/main_parser.pyÚ 2sÿz&create_main_parser..Ú )rr rZdisable_interspersed_argsrÚversionrZmake_option_groupZ general_groupZadd_option_groupÚmainrÚitemsÚjoinÚ description)Z parser_kwÚparserZgen_optsrrrrr s"û   þ cCsÊtƒ}| |¡\}}|jr>tj |j¡tj tj¡t ¡|rZ|ddkrjt |ƒdkrj|  ¡t ¡|d}|t kr¬t |ƒ}d|g}|rž|  d|¡td |¡ƒ‚|dd…}| |¡||fS)NrÚhelpézunknown command "%s"zmaybe you meant "%s"z - )r Ú parse_argsrÚsysÚstdoutÚwriteÚosÚlinesepÚexitÚlenZ print_helprrÚappendrrÚremove)ÚargsrZgeneral_optionsZ args_elseZcmd_nameZguessÚmsgZcmd_argsrrrr;s&    )Ú__doc__r$r!Zpip._internal.clirZpip._internal.cli.parserrrZpip._internal.commandsrrZpip._internal.exceptionsrZpip._internal.utils.miscrr Zpip._internal.utils.typingr Útypingr r Ú__all__r rrrrrÚs   #