B š•Re ã@sŒddlmZddlZddlZddlmZddlmZddlm Z ddl m Z e rhddl m Z ddlmZd Zd d d d œZGdd„deƒZdS)é)Úabsolute_importN)ÚCommand)ÚSUCCESS)Úget_prog)ÚMYPY_CHECK_RUNNING)ÚList)ÚValueszD # pip {shell} completion start{script}# pip {shell} completion end a _pip_completion() {{ COMPREPLY=( $( COMP_WORDS="${{COMP_WORDS[*]}}" \ COMP_CWORD=$COMP_CWORD \ PIP_AUTO_COMPLETE=1 $1 2>/dev/null ) ) }} complete -o default -F _pip_completion {prog} aM function _pip_completion {{ local words cword read -Ac words read -cn cword reply=( $( COMP_WORDS="$words[*]" \ COMP_CWORD=$(( cword-1 )) \ PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )) }} compctl -K _pip_completion {prog} au function __fish_complete_pip set -lx COMP_WORDS (commandline -o) "" set -lx COMP_CWORD ( \ math (contains -i -- (commandline -t) $COMP_WORDS)-1 \ ) set -lx PIP_AUTO_COMPLETE 1 string split \ -- (eval $COMP_WORDS[1]) end complete -fa "(__fish_complete_pip)" -c {prog} )ÚbashÚzshÚfishc@s$eZdZdZdZdd„Zdd„ZdS)ÚCompletionCommandz3A helper command to be used for command completion.TcCs\|jjddddddd�|jjdd dd dd d�|jjd d ddddd�|j d|j¡dS)Nz--bashz-bÚ store_constr ÚshellzEmit completion code for bash)ÚactionÚconstÚdestÚhelpz--zshz-zr zEmit completion code for zshz--fishz-fr zEmit completion code for fishr)Úcmd_optsÚ add_optionÚparserÚinsert_option_group)Úself©rú�/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/commands/completion.pyÚ add_options;s&zCompletionCommand.add_optionscCszt ¡}dd„t|ƒDƒ}|j|krZt t |jd¡jtƒd�¡}t t j||jd�ƒt St j  d d |¡¡¡t SdS) z-Prints the completion code of the given shellcSsg|] }d|‘qS)z--r)Ú.0rrrrú Vsz)CompletionCommand.run..Ú)Úprog)ÚscriptrzERROR: You must pass {} z or N)ÚCOMPLETION_SCRIPTSÚkeysÚsortedrÚtextwrapÚdedentÚgetÚformatrÚprintÚBASE_COMPLETIONrÚsysÚstderrÚwriteÚjoin)rÚoptionsÚargsZshellsZ shell_optionsrrrrÚrunRs  zCompletionCommand.runN)Ú__name__Ú __module__Ú __qualname__Ú__doc__Úignore_require_venvrr/rrrrr 6sr )Ú __future__rr)r#Úpip._internal.cli.base_commandrÚpip._internal.cli.status_codesrÚpip._internal.utils.miscrÚpip._internal.utils.typingrÚtypingrÚoptparserr(r r rrrrÚs