Re @sddlmZddlZddlZddlmZddlmZddlm Z ddl m Z e rddl m Z ddlmZd Zd d d d ddiZGdddeZdS))absolute_importN)Command)SUCCESS)get_prog)MYPY_CHECK_RUNNING)List)ValueszD # pip {shell} completion start{script}# pip {shell} completion end basha _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} zshaM 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} fishau 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} c@s4eZdZdZdZddZddZdS)CompletionCommandz3A helper command to be used for command completion.Tc Cs|jjddddddddd d |jjd d dddd ddd d|jjddddddddd d|jjd|jdS)Nz--bashz-baction store_constconstr destshellhelpzEmit completion code for bashz--zshz-zr zEmit completion code for zshz--fishz-fr zEmit completion code for fishr)cmd_opts add_optionparserinsert_option_group)selfr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/commands/completion.py add_options;s&      zCompletionCommand.add_optionscCstj}ddt|D}|j|krtjtj|jdjdt}t t jd|d|jt St j jdjdj|t Sd S) z-Prints the completion code of the given shellcSsg|]}d|qS)z--r).0rrrr Vs z)CompletionCommand.run..progscriptrzERROR: You must pass {} z or N)COMPLETION_SCRIPTSkeyssortedrtextwrapdedentgetformatrprintBASE_COMPLETIONrsysstderrwritejoin)roptionsargsZshellsZ shell_optionsrrrrrunRs  zCompletionCommand.runN)__name__ __module__ __qualname____doc__ignore_require_venvrr/rrrrr 6s  r ) __future__rr)r#pip._internal.cli.base_commandrpip._internal.cli.status_codesrpip._internal.utils.miscrpip._internal.utils.typingrtypingroptparserr(r r rrrrs"