ó
“àfac           @@  sÌ   d  d l  m Z d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l m	 Z	 d  d l
 m Z e r‘ d  d l m Z d  d l m Z n  d	 Z i d
 d 6d d 6d d 6Z d e f d „  ƒ  YZ d S(   i    (   t   absolute_importN(   t   Command(   t   SUCCESS(   t   get_prog(   t   MYPY_CHECK_RUNNING(   t   Values(   t   ListsD   
# pip {shell} completion start{script}# pip {shell} completion end
s  
        _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}
    t   bashsM  
        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}
    t   zshsu  
        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}
    t   fisht   CompletionCommandc           B@  s&   e  Z d  Z e Z d „  Z d „  Z RS(   s3   A helper command to be used for command completion.c         C@  s›   |  j  j d d d d d d d d d	 d
 ƒ|  j  j d d d d d d d d d	 d ƒ|  j  j d d d d d d d d d	 d ƒ|  j j d |  j  ƒ d  S(   Ns   --bashs   -bt   actiont   store_constt   constR   t   destt   shellt   helps   Emit completion code for bashs   --zshs   -zR   s   Emit completion code for zshs   --fishs   -fR	   s   Emit completion code for fishi    (   t   cmd_optst
   add_optiont   parsert   insert_option_group(   t   self(    (    s@   /tmp/pip-install-YjPQSb/pip/pip/_internal/commands/completion.pyt   add_options;   s&    						c         C@  s³   t  j ƒ  } g  t | ƒ D] } d | ^ q } | j | k r‰ t j t  j | j d ƒ j d t ƒ  ƒ ƒ } t	 j d | d | j ƒ GHt
 St j j d j d j | ƒ ƒ ƒ t
 Sd S(	   s-   Prints the completion code of the given shells   --t    t   progt   scriptR   s   ERROR: You must pass {}
s    or N(   t   COMPLETION_SCRIPTSt   keyst   sortedR   t   textwrapt   dedentt   gett   formatR   t   BASE_COMPLETIONR   t   syst   stderrt   writet   join(   R   t   optionst   argst   shellsR   t   shell_optionsR   (    (    s@   /tmp/pip-install-YjPQSb/pip/pip/_internal/commands/completion.pyt   runR   s    #	(   t   __name__t
   __module__t   __doc__t   Truet   ignore_require_venvR   R*   (    (    (    s@   /tmp/pip-install-YjPQSb/pip/pip/_internal/commands/completion.pyR
   6   s   	(   t
   __future__R    R"   R   t   pip._internal.cli.base_commandR   t   pip._internal.cli.status_codesR   t   pip._internal.utils.miscR   t   pip._internal.utils.typingR   t   optparseR   t   typingR   R!   R   R
   (    (    (    s@   /tmp/pip-install-YjPQSb/pip/pip/_internal/commands/completion.pyt   <module>   s   	
