ó
    B/õgin  ã                   ót  • S SK r S SKrS SKrS SKJr  S SKJrJrJrJ	r	J
r
JrJr  SSKJr  SSKJrJrJrJr  SSKJrJr  SSKJr  SS	KJrJrJrJr  \ R<                  \ R>                  \ R@                  \ RB                  \ RD                  \ RF                  \ RH                  1r%S
 r& " S S\'5      r( " S S\(5      r)g)é    N)ÚMapping)ÚCallableÚDictÚListÚOptionalÚSequenceÚTextIOÚUnioné   )Úio)ÚBaseCompleterÚChoicesCompleterÚFilesCompleterÚSuppressCompleter)ÚdebugÚmute_stderr)Ú
split_line)ÚIntrospectiveArgumentParserÚaction_is_greedyÚaction_is_openÚaction_is_satisfiedc                 ó$   • U R                  U5      $ ©N)Ú
startswith)Ú
completionÚprefixs     Ú5/usr/lib/python3/dist-packages/argcomplete/finders.pyÚdefault_validatorr      s   € Ø× Ñ  Ó(Ð(ó    c                   ó¾  • \ rS rSrSrSSSSS\" 5       S4S jrS\R                  SSSSS\" 5       4S\	R                  S\\\4   S	\S
\\   S\\\      S\\   S\S\\   S\SS4S jjrS rS rS rS rS rS r\S 5       rS rS\\	R                     S\	R<                  S\S\\   4S jrS r S\\   S\\   4S  jr!S\\   S!\S"\\"   S\\   4S# jr#S$ r$S% r%S&r&g)'ÚCompletionFinderé!   zð
Inherit from this class if you wish to override any of the stages below. Otherwise, use
``argcomplete.autocomplete()`` directly (it's a convenience instance of this class). It has the same signature as
:meth:`CompletionFinder.__call__()`.
NTFc                 óÐ   • Xl         X l        X0l        Uc  [        nX@l        XPl        SU l        0 U l        X`l        Uc"  [        R                  R                  S5      S:g  nXpl        g )NFÚ_ARGCOMPLETE_SUPPRESS_SPACEÚ1)Ú_parserÚalways_complete_optionsÚexcluder   Ú	validatorÚprint_suppressedÚ
completingÚ_display_completionsÚdefault_completerÚosÚenvironÚgetÚappend_space)ÚselfÚargument_parserr'   r(   r)   r*   r-   r1   s           r   Ú__init__ÚCompletionFinder.__init__(   sc   € ð 'ŒØ'>Ô$ØŒØÑÜ)ˆIØ"ŒØ 0ÔØˆŒØ46ˆÔ!Ø!2ÔØÑÜŸ:™:Ÿ>™>Ð*GÓHÈCÑOˆLØ(Õr   r3   r'   Úexit_methodÚoutput_streamr(   r)   r*   r1   r-   Úreturnc
           
      óÂ  • U R                  UUUUUUU	S9  S[        R                  ;  a  gU R                  5         UcH  [        R                  R	                  S5      n
U
b&  [        SR                  U
5      5        [        U
S5      nUc   [        R                  " SS5      nUc   e[        R                  R	                  S
S5      n[        U5      S	:w  a   [        SR                  US95        U" S	5        [        R                  R	                  S5      nU(       a/  [        U5      S	:w  a   [        SR                  US95        U" S	5        [        R                  S   n[        [        R                  S   5      n[        XÞ5      u  nnnnn[        [        R                  S   5      S	-
  nUUS nU(       aG  US   U R                  R                  ;   a*  SU;   a$  UR                  UR!                  SS	5      S   5        [        SR                  U5      SR                  U5      SR                  U5      SR                  U5      SR                  U5      SU5        U R#                  UUUU5      nU(       a„  U R$                  R'                  5        VVs0 s H"  u  nnUU(       a  UR)                  US5      OS_M$     nnnU Vs/ s H.  nUR+                  UUR	                  U5      =(       d    S45      PM0     nn[        R                  R	                  S5      S:X  a0  U Vs/ s H#  nU SU R$                  R	                  U5       3PM%     nn[        SU5        UR-                  UR+                  U5      5        UR/                  5         [0        R2                  R/                  5         U" S5        g! [         a    [        S5        U" S	5         GN,f = fs  snnf s  snf s  snf ) aõ  
:param argument_parser: The argument parser to autocomplete on
:param always_complete_options:
    Controls the autocompletion of option strings if an option string opening character (normally ``-``) has not
    been entered. If ``True`` (default), both short (``-x``) and long (``--x``) option strings will be
    suggested. If ``False``, no option strings will be suggested. If ``long``, long options and short options
    with no long variant will be suggested. If ``short``, short options and long options with no short variant
    will be suggested.
:param exit_method:
    Method used to stop the program after printing completions. Defaults to :meth:`os._exit`. If you want to
    perform a normal exit that calls exit handlers, use :meth:`sys.exit`.
:param exclude: List of strings representing options to be omitted from autocompletion
:param validator:
    Function to filter all completions through before returning (called with two string arguments, completion
    and prefix; return value is evaluated as a boolean)
:param print_suppressed:
    Whether or not to autocomplete options that have the ``help=argparse.SUPPRESS`` keyword argument set.
:param append_space:
    Whether to append a space to unique matches. The default is ``True``.

.. note::
    If you are not subclassing CompletionFinder to override its behaviors,
    use :meth:`argcomplete.autocomplete()` directly. It has the same signature as this method.

Produces tab completions for ``argument_parser``. See module docs for more info.

Argcomplete only executes actions if their class is known not to have side effects. Custom action classes can be
added to argcomplete.safe_actions, if their values are wanted in the ``parsed_args`` completer argument, or
their execution is otherwise desirable.
)r'   r(   r)   r*   r1   r-   Ú_ARGCOMPLETENÚ_ARGCOMPLETE_STDOUT_FILENAMEzUsing output file {}Úwé   z)Unable to open fd 8 for writing, quittingr   Ú_ARGCOMPLETE_IFSÚz%Invalid value for IFS, quitting [{v}])ÚvÚ_ARGCOMPLETE_DFSz%Invalid value for DFS, quitting [{v}]Ú	COMP_LINEÚ
COMP_POINTr   Ú=z
LINE: {!r}z
POINT: {!r}z
PREQUOTE: {!r}z
PREFIX: {!r}z
SUFFIX: {!r}z
WORDS:Ú Ú Ú_ARGCOMPLETE_SHELLÚzshÚ:z
Returning completions:)r4   r.   r/   Ú_init_debug_streamr0   r   ÚformatÚopenÚfdopenÚ	ExceptionÚlenÚintr   r&   Úprefix_charsÚappendÚsplitÚ_get_completionsr,   ÚitemsÚreplaceÚjoinÚwriteÚflushÚ_ioÚdebug_stream)r2   r3   r'   r6   r7   r(   r)   r*   r1   r-   ÚfilenameÚifsÚdfsÚ	comp_lineÚ
comp_pointÚcword_prequoteÚcword_prefixÚcword_suffixÚ
comp_wordsÚlast_wordbreak_posÚstartÚcompletionsÚkeyÚvalueÚdisplay_completionsÚcs                             r   Ú__call__ÚCompletionFinder.__call__@   sy  € ðT 	�‰ØØ$;ØØØ-Ø%Ø/ð 	ñ 	
ð ¤§¡Ó+àà×ÑÔ!àÑ Ü—z‘z—~‘~Ð&DÓEˆHØÑ#ÜÐ,×3Ñ3°HÓ=Ô>Ü $ X¨sÓ 3�àÑ ðÜ "§	¢	¨!¨SÓ 1�ð
 Ñ(Ð(Ð(ä�j‰j�n‰nÐ/°Ó8ˆÜˆs‹8�q‹=ÜÐ9×@Ñ@À3Ð@ÐGÔHÙ˜ŒNä�j‰j�n‰nÐ/Ó0ˆÞ”3�s“8˜q“=ÜÐ9×@Ñ@À3Ð@ÐGÔHÙ˜ŒNä—J‘J˜{Ñ+ˆ	ÜœŸ™ LÑ1Ó2ˆ
äU_Ð`iÓUvÑRˆ˜ l°JÐ@Rô ”B—J‘J˜~Ñ.Ó/°!Ñ3ˆØ  Ð'ˆ
æ˜L¨™O¨t¯|©|×/HÑ/HÓHÈSÐT`ÓM`à×Ñ˜l×0Ñ0°°aÓ8¸Ñ;Ô<äØ×!Ñ! )Ó,Ø×"Ñ" :Ó.Ø×%Ñ% nÓ5Ø×#Ñ# LÓ1Ø×#Ñ# LÓ1ØØô	
ð ×+Ñ+¨J¸ÀnÐVhÓiˆæàPT×PiÑPi×PoÑPoÔPqô#ÚPqÁ*À#Àu�¶�U—]‘] 3¨Ô,¸2Ò=ÑPqð  ñ #ñ [fÓfÒZeÐSV˜3Ÿ8™8 SÐ*=×*AÑ*AÀ#Ó*F×*LÈ"Ð$MÖNÑZeˆKÐfä�:‰:�>‰>Ð.Ó/°5Ó8ÙNYÓZÊkÈ˜a˜S  $×";Ñ";×"?Ñ"?ÀÓ"BÐ!CÓDÉkˆKÐZäÐ(¨+Ô6Ø×Ñ˜CŸH™H [Ó1Ô2Ø×ÑÔÜ×Ñ×ÑÔ Ù�A�øôu ó ÜÐAÔBÙ˜A—ðüó\#ùò gùò [s$   Â
N- Ê)OË 5OÌ*OÎ-OÏOc                 ó¬   •  [         R                  " SS5      [        l        [        5         g! [         a    [
        R                  [        l         N0f = f)zêInitialize debug output stream

By default, writes to file descriptor 9, or stderr if that fails.
This can be overridden by derived classes, for example to avoid
clashes with file descriptors being used elsewhere (such as in pytest).
é	   r<   N)r.   rM   rZ   r[   rN   ÚsysÚstderrr   ©r2   s    r   rJ   Ú#CompletionFinder._init_debug_stream¿   s>   € ð	*Ü!Ÿyšy¨¨CÓ0ŒCÔô 	�øô ó 	*Ü"Ÿz™zŒCÖð	*ús   ‚ - ­#AÁAc                 ó  • U R                  5       n[        R                  " 5       nSU l         [	        SUSS  5        [        5          U R                  R                  USS  US9nS S S 5        [	        SW5        SU l        S	U;   a  SU l        U R                  XVU5      n	U R                  U	5      n	U R                  X“U5      n	U	$ ! , (       d  f       Ne= f! [         a*  n[	        S[        U5      [        U5      S5         S nAN‹S nAff = f)
NTzinvoking parser withr   )Ú	namespacezparsed args:z

exceptionzwhile parsing argsFz--)Ú_patch_argument_parserÚargparseÚ	Namespacer+   r   r   r&   Úparse_known_argsÚBaseExceptionÚtypeÚstrr'   Úcollect_completionsÚfilter_completionsÚquote_completions)
r2   rd   rb   ra   re   Úactive_parsersÚparsed_argsÚaÚerg   s
             r   rT   Ú!CompletionFinder._get_completionsÌ   sø   € Ø×4Ñ4Ó6ˆä×(Ò(Ó*ˆØˆŒð	HÜÐ(¨*°Q°R¨.Ô9Ü•Ø—L‘L×1Ñ1°*¸Q¸R°.ÈKÐ1ÐX�÷ ä�. !Ô$ð  ˆŒà�:ÓØ+0ˆDÔ(à×.Ñ.¨~ÈLÓYˆØ×-Ñ-¨kÓ:ˆØ×,Ñ,¨[ÐJ\Ó]ˆØÐ÷ •ûô ó 	HÜ�-¤ a£¬#¨a«&Ð2F×GÑGûð	Hús/   ®C ÁCÁ%C Ã
CÃC Ã
D	Ã DÄD	c                 óÈ   ^^• / U l         / U l        U mUU4S jmT" U R                  5        [        SU R                   5        [        SU R                  5        U R                   $ )a�  
Since argparse doesn't support much introspection, we monkey-patch it to replace the parse_known_args method and
all actions with hooks that tell us which action was last taken or about to be taken, and let us have the parser
figure out which subparsers need to be activated (then recursively monkey-patch those).
We save all active ArgumentParsers to extract all their possible option names later.
c                 ó´  >• TR                   R                  U 5        TR                  R                  U 5        [        U [        5      (       a  g Sn[        U[        U R                  40 5      U l        U R                   HW  n[        US5      (       a  M   " UU4S jSUR                  5      nUR                  Ul	        UR                  Ul        X2l        MY     g )NÚ(MonkeyPatchedIntrospectiveArgumentParserÚ_orig_classc                   ó(   >• \ rS rSrSU U4S jjrSrg)ÚPCompletionFinder._patch_argument_parser.<locals>.patch.<locals>.IntrospectActioné   Nc                 ó0  >• [        SU 5        [        SXX45        [        SU R                  5        [        SU R                  5        TR                  (       d  U R                  XX4S9  g [	        U R                  [
        R                  5      (       a4  [        S5        T" U R                  US      5        U R                  XX4S9  g U R                  [        ;   a=  U R                  (       d  TR                  R                  U 5        U R                  XX4S9  g g )NzAction stub called onz	args:z	orig class:z	orig callable:)Úoption_stringz:orig class is a subparsers action: patching and running itr   )r   rˆ   Ú_orig_callabler+   Ú
issubclassrw   Ú_SubParsersActionÚ_name_parser_mapÚsafe_actionsÚoption_stringsÚvisited_positionalsrR   )r2   Úparserru   Úvaluesr�   Ú	completerÚpatchs        €€r   rl   ÚYCompletionFinder._patch_argument_parser.<locals>.patch.<locals>.IntrospectAction.__call__  sæ   ø€ ÜÐ5°tÔ<Ü˜i¨¸FÔRÜ˜o¨t×/?Ñ/?Ô@ÜÐ0°$×2EÑ2EÔFà(×3×3Ø ×/Ñ/°À6Ð/ÒgÜ'¨×(8Ñ(8¼(×:TÑ:T×UÑUÜ!Ð"^Ô_Ù! $×"7Ñ"7¸¸q¹	Ñ"BÔCØ ×/Ñ/°À6Ð/ÒgØ!×-Ñ-´Ó=Ø#'×#6×#6Ø )× =Ñ =× DÑ DÀTÔ Jà ×/Ñ/°À6Ð/Ògð	 >r   © r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rl   Ú__static_attributes__)r—   r˜   s   €€r   ÚIntrospectActionrŠ      s   ø† ÷hó hr   r    )r”   rR   r€   Ú
isinstancer   r{   Ú	__class__Ú_actionsÚhasattrrˆ   rl   rŽ   )r•   Ú	classnameÚactionr    r—   r˜   s       €€r   r˜   Ú6CompletionFinder._patch_argument_parser.<locals>.patchð   s¹   ø€ Ø×)Ñ)×0Ñ0°Ô8Ø×$Ñ$×+Ñ+¨FÔ3ä˜&Ô"=×>Ñ>ØàBˆIä# IÔ0KÈV×M]ÑM]Ð/^Ð`bÓcˆFÔà Ÿ/œ/�Ü˜6 =×1Ñ1Ù÷hð h v×'7Ñ'7ô hð& &,×%5Ñ%5�Ô"Ø(.¯©�Ô%Ø#3Ö ò5 *r   zActive parsers:zVisited positionals:)r€   r”   r&   r   )r2   r—   r˜   s    @@r   rv   Ú'CompletionFinder._patch_argument_parserä   s]   ù€ ð >@ˆÔØ:<ˆÔ àˆ	ö%	4ñN 	ˆd�l‰lÔäÐ ×!4Ñ!4Ô5ÜÐ$ d×&>Ñ&>Ô?à×"Ñ"Ð"r   c                 ó  • 0 nUR                   R                  5        H3  nUR                   U   nUR                  U/ 5      R                  U5        M5     UR	                  5        H_  nX1R                   UR
                         H=  nUR                  U5      (       d  M  UR                  =(       d    SU R                  U'   M?     Ma     UR                   R                  5        Vs/ s H  oˆR                  U5      (       d  M  UPM     n	nU	$ s  snf )NrF   )	ÚchoicesÚkeysÚ
setdefaultrR   Ú_get_subactionsÚdestr   Úhelpr,   )
r2   r•   rb   Úaliases_by_parserrh   Úpr¦   ÚaliasÚsubcmdrg   s
             r   Ú_get_subparser_completionsÚ+CompletionFinder._get_subparser_completions  sß   € ØFHÐØ—>‘>×&Ñ&Ö(ˆCØ—‘˜sÑ#ˆAØ×(Ñ(¨¨BÓ/×6Ñ6°sÖ;ñ )ð ×,Ñ,Ö.ˆFØ*¯>©>¸&¿+¹+Ñ+FÔG�Ø×#Ñ# L×1Ó1Ø7=·{±{×7HÀb�D×-Ñ-¨eÓ4ó Hñ /ð
 -3¯N©N×,?Ñ,?Ô,AÓeÒ,A &×EVÑEVÐWc×Ed—vÑ,AˆÐeØÐùò fs   Ã#D
Ä D
c                 óè  • [        U5      S:”  d  U R                  SL a4  UR                   Vs/ s H  o3R                  U5      (       d  M  UPM     sn$ UR                   Vs/ s H  n[        U5      S:”  d  M  UPM     nnUR                   Vs/ s H  n[        U5      S::  d  M  UPM     nnU R                  S:X  a  U(       a  U$ U$ U R                  S:X  a  U(       a  U$ U$ / $ s  snf s  snf s  snf )Nr   Té   ÚlongÚshort)rO   r'   r“   r   )r2   r¦   rb   ÚoptÚ	long_optsÚ
short_optss         r   Ú_include_optionsÚ!CompletionFinder._include_options,  sÕ   € Üˆ|Ó˜qÓ  D×$@Ñ$@ÀDÒ$HØ#)×#8Ò#8ÓYÒ#8˜C¿N¹NÈ<×<X—CÑ#8ÑYÐYØ$*×$9Ò$9ÓJÒ$9˜S¼SÀ»XÈ¹\—SÑ$9ˆ	ÐJØ%+×%:Ò%:ÓLÒ%:˜c¼cÀ#»hÈ!¹m—cÑ%:ˆ
ÐLØ×'Ñ'¨6Ó1Þ )�9Ð9¨zÐ9Ø×)Ñ)¨WÓ4Þ!+�:Ð:°Ð:Øˆ	ùò ZùÚJùÚLs#   ­C%Á
C%Á!C*Á8C*ÂC/Â%C/c                 ó‚  • UR                    Hc  nUR                  (       d  M  UR                   H=  nUR                  U5      (       d  M  UR                  =(       d    SU R                  U'   M?     Me     / nUR                    H¹  nU R
                  (       dY  [        USS 5      n[        U[        5      (       a  UR                  5       (       a  MM  UR                  [        R                  :X  a  Mm  U R                  X15      (       d  M…  [        U[        R                  5      (       a  M¦  XPR                  X25      -  nM»     U$ )NrF   r—   )r£   r“   r   r¯   r,   r*   Úgetattrr¡   r   Úsuppressrw   ÚSUPPRESSÚ_action_allowedr�   r½   )r2   r•   rb   r¦   r�   Úoption_completionsr—   s          r   Ú_get_option_completionsÚ(CompletionFinder._get_option_completions7  sû   € Ø—o”oˆFØ×$×$Ñ$Ø%+×%:Ô%:�MØ$×/Ñ/°×=Ó=ØCIÇ;Á;×CTÐRT˜×1Ñ1°-Ó@ó &;ñ &ð  ÐØ—o”oˆFØ×(×(Ü# F¨K¸Ó>�	Ü˜iÔ):×;Ñ;À	×@RÑ@R×@TÑ@TÙØ—;‘;¤(×"3Ñ"3Ó3ÙØ×'Ñ'¨×7Ñ7ÙÜ˜f¤h×&@Ñ&@×AÓAØ"×&;Ñ&;¸FÓ&QÑQÒ"ñ &ð "Ð!r   c                 ól   • UR                   R                  U / 5       H  nX!R                  ;   d  M    g   g©NFT)Ú_action_conflictsr0   Ú_seen_non_default_actions)r¦   r•   Úconflict_actions      r   rÃ   Ú CompletionFinder._action_allowedL  s6   € ð  &×7Ñ7×;Ñ;¸FÀBÖGˆOØ×"BÑ"BÕBÙñ  Hð r   c                 óv  • [        SR                  [        UR                  5      UR                  S95        U=(       a    US   UR                  ;   nSnUR                   Vs/ s H  n[        X†5      (       d  M  UPM     n	nU	(       a0  [        U	5      S:X  d   S5       e[        SU	S   S5        0 U l        / nO$U(       a  S	U;   a  UR                  S	5      u  pznOU$ S
nU	=(       d    UR                   GH¶  nUR                  (       dG  [        U5      (       a  SnU(       d.  [        U5      (       a  [        U5      (       d  [        SU5        M\  [        SXÌR                  5        [        USS 5      nUcm  UR                  b5  [        U[        R                   5      (       d  [#        UR                  5      nO+[        U[        R                   5      (       d  U R$                  nU(       d  Mø  [        U[&        5      (       a  UR)                  5       (       a  GM%  [+        U5      (       aê  U" X<XS9n[        U[,        5      (       aS  UR/                  5        H>  u  nnU R1                  Xó5      (       d  M  UR3                  U5        UU R                  U'   M@     OèU Ht  nU R1                  Xó5      (       d  M  UR3                  U5        [        U["        5      (       a$  UR4                  =(       d    SU R                  U'   Me  SU R                  U'   Mv     Om[        S5        [7        S5       HS  nUR9                  UU5      nUc    O=U R1                  UU5      (       d  M3  SU R                  U'   UR3                  U5        MU     U(       a  U Vs/ s H
  o÷S	-   U-   PM     nn[        SU5        GM¹     U$ s  snf s  snf )NzActive actions (L={l}): {a})Úlr‚   r   rF   r   zexpect at most 1 greedy actionzResetting completions becausezmust consume the next argumentrD   FTÚSkippingzActivating completion forr—   )r   r¦   r•   r�   zICompleter is not callable, trying the readline completer protocol insteadi'  zCompletions:)r   rK   rO   Úactive_actionsrQ   r   r,   Ú	partitionr“   r   r   rˆ   rÀ   rª   r¡   rw   r�   r   r-   r   rÁ   Úcallabler   rU   r)   rR   r¯   ÚrangeÚcomplete)r2   r•   Únext_positionalrb   r�   rg   Ú
isoptionalÚoptional_prefixÚxÚgreedy_actionsÚ_Úcomplete_remaining_positionalsÚactive_actionr—   Úcompleter_outputr   ÚdescriptionÚiÚnext_completions                      r   Ú_complete_active_optionÚ(CompletionFinder._complete_active_optionU  sK  € ÜÐ+×2Ñ2´S¸×9NÑ9NÓ5OÐSY×ShÑShÐ2ÐiÔjà!×L l°1¡o¸×9LÑ9LÑ&Lˆ
ØˆØ%+×%:Ò%:Ó^Ò%: Ô>NÈq×>]Ÿ!Ñ%:ˆÐ^ÞÜ�~Ó&¨!Ó+ÐMÐ-MÓMÐ+ô Ð1°>À!Ñ3DÐFfÔgØ(*ˆDÔ%Ø‰KÞØ�lÓ"ð 4@×3IÑ3IÈ#Ó3NÑ0�¡Lð #Ð"à).Ð&à+×D¨v×/DÑ/DÓDˆMØ ×/×/Ü! -×0Ñ0ð 6:Ð2Þ5Ü*¨=×9Ñ9Ä.ÐQ^×B_ÑB_Ü˜j¨-Ô8Ù äÐ-¨}×>WÑ>WÔXä ¨{¸DÓAˆIàÑ Ø ×(Ñ(Ñ4¼ZÈÔW_×WqÑWq×=rÑ=rÜ 0°×1FÑ1FÓ G‘IÜ# M´8×3MÑ3M×NÑNØ $× 6Ñ 6�IçˆyÜ˜iÔ):×;Ñ;À	×@RÑ@R×@TÑ@TÚä˜I×&Ñ&Ù'0Ø+È&ñ(Ð$ô "Ð"2´G×<Ñ<Ø7G×7MÑ7MÖ7OÑ3˜J¨Ø#Ÿ~™~¨j×GÓGØ +× 2Ñ 2°:Ô >ØHS × 9Ñ 9¸*Ó Eò 8Pó
 +;˜JØ#Ÿ~™~¨j×GÓGØ +× 2Ñ 2°:Ô >Ü#-¨iÔ9I×#JÑ#JØLY×L^ÑL^×LdÐbd D×$=Ñ$=¸jÓ$IàLN D×$=Ñ$=¸jÓ$Iò +;ô ÐeÔfÜ" 4ž[˜Ø*3×*<Ñ*<¸\È1Ó*M˜Ø*Ñ2Ù!ØŸ>™>¨/¸<×HÓHØIK˜D×5Ñ5°oÑFØ'×.Ñ.¨Ö?ñ )ö #ÙXcÓ"dÒXcÈ*°SÑ#8¸:Ô#EÑXc�KÐ"dÜ�n k×2ñq Eðr Ðùò[ _ùòV #es   Á"N1Á:N1ÎN6r€   r�   rb   c                 óî  • / n[        SU5        US   n[        SU5        U R                  (       d"  [        U5      S:”  a&  US   UR                  ;   a  X@R	                  XS5      -  n[        SU5        U R                  5       n[        SU5        [        U[        R                  5      (       a  X@R                  Xc5      -  nU R                  XVX2U5      n[        SU5        [        SU R                  5        U$ )	a  
Visits the active parsers and their actions, executes their completers or introspects them to collect their
option strings. Returns the resulting completions as a list of strings.

This method is exposed for overriding in subclasses; there is no need to use it directly.
zall active parsers:éÿÿÿÿzactive_parser:r   zoptional options:znext_positional:zactive options:zdisplay completions:)r   r'   rO   rQ   rÅ   Ú_get_next_positionalr¡   rw   r�   r´   rá   r,   )r2   r€   r�   rb   rg   Úactive_parserrÕ   s          r   r}   Ú$CompletionFinder.collect_completions©  sé   € ð "$ˆäÐ# ^Ô4Ø& rÑ*ˆÜÐ Ô.Ø×'×'¬C°Ó,=ÀÓ,AÀlÐSTÁoÐYf×YsÑYsÓFsØ×7Ñ7¸ÓTÑTˆKÜÐ! ;Ô/à×3Ñ3Ó5ˆÜÐ  /Ô2ä�o¤x×'AÑ'A×BÑBØ×:Ñ:¸?ÓYÑYˆKà×2Ñ2Ø¨LÀ{ó
ˆô 	Ð Ô-ÜÐ$ d×&?Ñ&?Ô@àÐr   c                 ó  • U R                   S   nU R                  S   nUR                  5       nU(       d  gX:X  a  US   $ Sn[        [	        U5      5       H  nX4   U:X  d  M    O   US-   [	        U5      :  a  X4S-      $ g)z.
Get the next positional action if it exists.
rä   Nr   r   )r€   r”   Ú_get_positional_actionsrÓ   rO   )r2   ræ   Úlast_positionalÚall_positionalsrß   s        r   rå   Ú%CompletionFinder._get_next_positionalÉ  s“   € ð ×+Ñ+¨BÑ/ˆØ×2Ñ2°2Ñ6ˆà'×?Ñ?ÓAˆÞØàÓ+Ø" 1Ñ%Ð%àˆÜ”s˜?Ó+Ö,ˆAØÑ! _Õ4Ùñ -ð ˆq‰5”3�Ó'Ó'Ø" q¡5Ñ)Ð)àr   rg   c                 óˆ   • / nU H9  nU R                   b  X0R                   ;   a  M!  X2;  d  M(  UR                  U5        M;     U$ )zÏ
De-duplicates completions and excludes those specified by ``exclude``.
Returns the filtered completions as a list.

This method is exposed for overriding in subclasses; there is no need to use it directly.
)r(   rR   )r2   rg   Úfiltered_completionsr   s       r   r~   Ú#CompletionFinder.filter_completionsá  sG   € ð  "ÐÛ%ˆJØ�|‰|Ñ'Ø§¡Ó-ÙØÕ5Ø$×+Ñ+¨JÖ7ñ &ð $Ð#r   ra   re   c                 ó4  • SnUS:X  a   Ub  U Vs/ s H
  oUUS-   S PM     nnUS-  nOUS:X  a  US-  n[         R                  R                  S5      S	;   a  SnO)US
:X  a#  SnU Vs/ s H  oUR                  S
S5      PM     nn[         R                  R                  S5      S:X  a  SnUR                  SS5      nO*Sn[         R                  R                  S5      S:X  a  US-  n/ nU H`  nUn	U H  n
U	R                  X¦U
-   5      n	M     UR	                  U	5        X€R
                  ;   d  MD  U R
                  U   U R
                  U	'   Mb     U R                  (       a0  Sn[        U5      S:X  a  US   S   U;  a  US:X  a  US==   S-  ss'   U$ s  snf s  snf )a„  
If the word under the cursor started with a quote (as indicated by a nonempty ``cword_prequote``), escapes
occurrences of that quote character in the completions, and adds the quote to the beginning of each completion.
Otherwise, escapes all characters that bash splits words on (``COMP_WORDBREAKS``), and removes portions of
completions before the first colon if (``COMP_WORDBREAKS``) contains a colon.

If there is only one completion, and it doesn't end with a **continuation character** (``/``, ``:``, or ``=``),
adds a space after the completion.

This method is exposed for overriding in subclasses; there is no need to use it directly.
Ú\rF   Nr   z();<>|&!`$* 	
"'Ú"z"`$!rG   )ÚtcshÚfishÚ'z'\''Ú
powershellÚ`rH   rI   z=/:r   rä   rE   )r.   r/   r0   rV   rR   r,   r1   rO   )r2   rg   ra   re   Úspecial_charsrk   Úescape_charÚescaped_completionsr   Úescaped_completionÚcharÚcontinuation_charss               r   r   Ú"CompletionFinder.quote_completionsñ  sÂ  € ð ˆð ˜RÓð "Ñ-ÙDOÓPÂK¸qÐ!3°aÑ!7Ð!9Ó:ÁK�ÐPØÐ2Ñ2‰MØ˜sÓ"Ø˜VÑ#ˆMä�:‰:�>‰>Ð.Ó/Ð3CÓCà‰MØ˜sÓ"ð ˆMÙ<GÓHºK°qŸ9™9 S¨'Ö2¹KˆKÐHô �:‰:�>‰>Ð.Ó/°<Ó?ØˆKØ)×1Ñ1°#°rÓ:‰MàˆKÜ�z‰z�~‰~Ð2Ó3°uÓ<à Ñ$�à ÐÛ%ˆJØ!+ÐÛ%�Ø%7×%?Ñ%?ÀÐTXÑFXÓ%YÒ"ñ &à×&Ñ&Ð'9Ô:Ø×6Ñ6Õ6Ø@D×@YÑ@YÐZdÑ@e�×)Ñ)Ð*<Ó=ñ &ð ××ð "'ÐÜÐ&Ó'¨1Ó,Ð1DÀQÑ1GÈÑ1KÐSeÓ1eØ! RÓ'Ø'¨Ó*¨cÑ1Ó*à"Ð"ùòU Qùò Is   �FÁ&Fc                 ó>  • US:X  aj  [        U5      u  p4pVnUR                  S[        R                  S   5        U R	                  XdX75      nU V	s/ s H  o‘U	[        U5      S -   PM     sn	U l        U[        U R                  5      :  a  U R                  U   $ gs  sn	f )a  
Alternate entry point for using the argcomplete completer in a readline-based REPL. See also
`rlcompleter <https://docs.python.org/3/library/rlcompleter.html#completer-objects>`_.
Usage:

.. code-block:: python

    import argcomplete, argparse, readline
    parser = argparse.ArgumentParser()
    ...
    completer = argcomplete.CompletionFinder(parser)
    readline.set_completer_delims("")
    readline.set_completer(completer.rl_complete)
    readline.parse_and_bind("tab: complete")
    result = input("prompt> ")
r   N)r   Úinsertrp   ÚargvrT   rO   Ú_rl_matches)
r2   ÚtextÚstatera   rb   rc   rd   Úfirst_colon_posÚmatchesÚmatchs
             r   Úrl_completeÚCompletionFinder.rl_complete3  s›   € ð" �A‹:ÜV`ÐaeÓVfÑSˆN¨,ÀOØ×Ñ˜a¤§¡¨!¡Ô-Ø×+Ñ+¨JÀnÓfˆGÙOVÓWÊwÀe u¬S°Ó->Ð-@Ð'AÔ AÉwÑWˆDÔà”3�t×'Ñ'Ó(Ó(Ø×#Ñ# EÑ*Ð*àùò  Xs   ÁBc                 ó   • U R                   $ )zb
This function returns a mapping of completions to their help strings for displaying to the user.
)r,   rr   s    r   Úget_display_completionsÚ(CompletionFinder.get_display_completionsO  s   € ð ×(Ñ(Ð(r   )r,   r&   r  r€   r'   r1   r+   r-   r(   r*   r)   r”   )'r›   rœ   r�   rž   Ú__doc__r   r4   r.   Ú_exitrw   ÚArgumentParserr
   Úboolr|   r   r   r	   r   r   rl   rJ   rT   rv   r´   r½   rÅ   ÚstaticmethodrÃ   rá   r   rx   r}   rå   r~   rP   r   r  r  rŸ   rš   r   r   r!   r!   !   s·  † ñð Ø $ØØØÙ(Ó*Øô)ð6 59Ø "§¡Ø*.Ø+/Ø(,Ø!&Ø'+Ù+9Ó+;ñ}à!×0Ñ0ð}ð "' t¨S yÑ!1ð}ð ð	}ð
   Ñ'ð}ð ˜( 3™-Ñ(ð}ð ˜HÑ%ð}ð ð}ð ˜t‘nð}ð )ð}ð 
õ}ò~òò08#òtò	ò"ð* ñó ðòRðhØ" 8×#:Ñ#:Ñ;ðØJR×J\ÑJ\ðØloðà	ˆc‰ôò@ð0$¨d°3©ið $¸DÀ¹Iô $ð @#Ø ™9ð@#Ø69ð@#ØOWÐX[É}ð@#à	ˆc‰ô@#òDõ8)r   r!   c                   ó$   • \ rS rSr\S 5       rSrg)ÚExclusiveCompletionFinderiV  c                 ó¼   • [         R                  X5      (       d  g[        R                  [        R                  4nU R
                  U;   a  gXR                  ;  a  ggrÈ   )r!   rÃ   rw   Ú_AppendActionÚ_AppendConstActionrˆ   rÊ   )r¦   r•   Úappend_classess      r   rÃ   Ú)ExclusiveCompletionFinder._action_allowedW  sO   € ä×/Ñ/°×?Ñ?Øä"×0Ñ0´(×2MÑ2MÐNˆØ×Ñ Ó/Øà×9Ñ9Ó9Øàr   rš   N)r›   rœ   r�   rž   r  rÃ   rŸ   rš   r   r   r  r  V  s   † Øñó ór   r  )*rw   r.   rp   Úcollections.abcr   Útypingr   r   r   r   r   r	   r
   rF   r   rZ   Ú
completersr   r   r   r   r   r   Úlexersr   Úpackages._argparser   r   r   r   Ú_StoreActionÚ_StoreConstActionÚ_StoreTrueActionÚ_StoreFalseActionr  r  Ú_CountActionr’   r   Úobjectr!   r  rš   r   r   Ú<module>r$     sš   ðó Û 	Û 
Ý #ß J× JÑ Jå ß ZÓ Zß "Ý ß rÓ rð ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×Ñð€ò)ôr)�vô r)ôjÐ 0õ r   