
    5h<                    8   S SK r S SKrS SKrS SKrS SKrS SKrS SKJr  S SK	J
r
  S SK	Jr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SK J!r!  S
SK J"r"  S
SK#J$r$  S
SK#J%r%  S
SK#J&r&  S
SK'J(r(  S
SK'J)r)  S
SK'J*r*  S
SK+J,r,  S
SK+J-r-  S
SK+J.r.  S
SK+J/r/  S
S K+J0r0  S
S!K+J1r1  \Rd                  (       a  S SK3r4S
S"K5J6r6  S
S#K7J8r8  \Rr                  " S$\Rt                  S%\Rv                  4   S&9r<\Rr                  " S'5      r=S(S)S*\>S+\R~                  \R                  \>S,4      4S- jrA SOS.S/S0\>S1S,S2\BS+S4
S3 jjrCS4\R                  \=   S5\ES+\R                  \R                  \=S%4      4S6 jrG\
 SPS(S)S7\R                  S8   S+\R~                  S   4S9 jj5       rIS:\R                  S8   S;\R                  S8   S+\R                  S8   4S< jrK " S= S>\ R                  5      rM " S? S)5      rN " S@ SA5      rO " SB S,\O5      rP " SC S/\P5      rQ " SD SE\Q5      rR " SF SG\Q5      rSSH\Rv                  S+\R~                  \Rv                     4SI jrT " SJ S85      rU " SK SL\U5      rV " SM SN\U5      rWg)Q    N)abc)contextmanager)	ExitStack)update_wrapper)gettext)ngettext)repeat)TracebackType   )typesAbort)BadParameter)ClickExceptionExit)MissingParameter
UsageError)HelpFormatter)join_options)pop_context)push_context_flag_needs_value)OptionParser)	split_opt)confirm)prompt)style)_detect_program_name)_expand_args)echo)make_default_short_help)make_str)PacifyFlushWrapper
HelpOptionCompletionItemF.)boundVctxContext
incompletereturnCommandc              #     #    [         R                  " [        U R                  5      nUR	                  U 5       HI  nUR                  U5      (       d  M  UR                  X5      nUc  M1  UR                  (       a  MD  X44v   MK     g7f)zList all the subcommands of a group that start with the
incomplete value and aren't hidden.

:param ctx: Invocation context for the group.
:param incomplete: Value being completed. May be empty.
N)tcastMultiCommandcommandlist_commands
startswithget_commandhidden)r.   r0   multinamer7   s        U/var/www/html/cementerio_25MayoBackend/env/lib/python3.13/site-packages/click/core.py_complete_visible_commandsr?   2   se      FF<-E##C(??:&&''2G"7>>>m# )s   ABB*B=
Bbase_commandr6   cmd_namecmdregisterc                 $   U R                   (       a  [        U[        5      (       d  g U(       a  SnOSn[        U SU R                  < SU< SU< S[        U5      R                   S[        U 5      R                   SU R                  < S	35      e)
NzdIt is not possible to add multi commands as children to another multi command that is in chain mode.zdFound a multi command as subcommand to a multi command that is in chain mode. This is not supported.z
. Command z is set to chain and zA was added as a subcommand but it in itself is a multi command. (z is a z within a chained z named z).)chain
isinstancer6   RuntimeErrorr=   type__name__)r@   rA   rB   rC   hints        r>   _check_multicommandrK   E   s     Z\%B%B< 	= 	 &
<,,/ 0< $<vd3i.@.@-A
T,/889 : 		$     iterable
batch_sizec           	      J    [        [        [        [        U 5      U5      6 5      $ N)listzipr	   iter)rM   rN   s     r>   batchrT   ]   s    VDNJ7899rL   param	Parameterc              #      #     Sv   g! [          a/  nUR                  c  Xl        Ub  UR                  c  Xl        e SnAf[         a  nUR                  c  Xl        e SnAff = f7f)z>Context manager that attaches extra information to exceptions.N)r   r.   rU   r   )r.   rU   es      r>   augment_usage_errorsrY   a   sZ     
 55=EG 55=Es.   A&	 A&
A#*=A#
AA##A&invocation_orderdeclaration_orderc                 d   ^  SSS[         R                  [        [        4   4U 4S jjn[	        XS9$ )a  Returns all declared parameters in the order they should be processed.

The declared parameters are re-shuffled depending on the order in which
they were invoked, as well as the eagerness of each parameters.

The invocation order takes precedence over the declaration order. I.e. the
order in which the user provided them to the CLI is respected.

This behavior and its effect on callback evaluation is detailed at:
https://click.palletsprojects.com/en/stable/advanced/#callback-evaluation-order
itemrV   r1   c                    >  TR                  U 5      nU R                  (       + U4$ ! [         a    [        S5      n N*f = f)Ninf)index
ValueErrorfloatis_eager)r]   idxrZ   s     r>   sort_key,iter_params_for_processing.<locals>.sort_key   sF    	)//5C == #%%  	,C	s   ' ??key)r4   Tupleboolrb   sorted)rZ   r[   re   s   `  r>   iter_params_for_processingrl   t   s1     &{ &qwwtU{'; & #22rL   c                       \ rS rSrSr\R                  " 5       r \R                  " 5       r \R                  " 5       r	 \R                  " 5       r
 \R                  " 5       rSrg)ParameterSource   a<  This is an :class:`~enum.Enum` that indicates the source of a
parameter's value.

Use :meth:`click.Context.get_parameter_source` to get the
source for a parameter by name.

.. versionchanged:: 8.0
    Use :class:`~enum.Enum` and drop the ``validate`` method.

.. versionchanged:: 8.0
    Added the ``PROMPT`` value.
 N)rI   
__module____qualname____firstlineno____doc__enumautoCOMMANDLINEENVIRONMENTDEFAULTDEFAULT_MAPPROMPT__static_attributes__rp   rL   r>   rn   rn      sO     ))+K:))+K>iikG6))+KAYY[F@rL   rn   c            #          \ rS rSr% Sr\r\R                  S   \	S'                  SLSSS\R                  S    S	\R                  \   S
\R                  \R                     S\R                  \   S\R                  \R                  \\R                  4      S\R                  \   S\R                  \   S\S\R                  \   S\R                  \   S\R                  \   S\R                  \R                   \      S\R                  \R"                  \/\4      S\R                  \   S\R                  \   SS4"S jjrS\R&                  \\R                  4   4S jrSMS jrS\R                  \R                  \      S\R                  \   S\R                  \   SS4S jr\SNS\S\R4                  S    4S  jj5       r\S\R&                  \\R                  4   4S! j5       rS\4S" jrS#\R>                  \    S\ 4S$ jr!S%\R"                  S&\R                  4   S\R"                  S&\R                  4   4S' jr"SOS( jr#\S\4S) j5       r$SMS* jr%S+\R                  \    S\R                  \    4S, jr&S+\R                  \    S\ 4S- jr'\RP                   SNS.\S/S0S\R                  \R                     4S1 jj5       r)\RP                   SPS.\S/S2S\R                  \RT                  \R                  \R"                  / \R                  4   4      4S3 jj5       r)SNS.\S/\S\R                  \R                     4S4 jjr)S5\SS64S7 jr+SQS8 jr,SRS9\SS64S: jjr-S\4S; jr.S\4S< jr/SSS= jr0\RP                  S>S?S@\R                  SA\R                  S\ 4SB j5       r1\RP                  S>SS@\R                  SA\R                  S\R                  4SC j5       r1S>\RT                  SD   S@\R                  SA\R                  S\RT                  \R                  \ 4   4SE jr1SFSS@\R                  SA\R                  S\R                  4SG jr2S.\SH\3SS4SI jr4S.\S\R                  \3   4SJ jr5SKr6g)Tr/      a  The context is a special internal object that holds state relevant
for the script execution at every single level.  It's normally invisible
to commands unless they opt-in to getting access to it.

The context is useful as it can pass internal objects around and can
control special execution features such as reading data from
environment variables.

A context can be used as context manager in which case it will call
:meth:`close` on teardown.

:param command: the command class for this context.
:param parent: the parent context.
:param info_name: the info name for this invocation.  Generally this
                  is the most descriptive name for the script or
                  command.  For the toplevel script it is usually
                  the name of the script, for commands below it it's
                  the name of the script.
:param obj: an arbitrary object of user data.
:param auto_envvar_prefix: the prefix to use for automatic environment
                           variables.  If this is `None` then reading
                           from environment variables is disabled.  This
                           does not affect manually set environment
                           variables which are always read.
:param default_map: a dictionary (like object) with default values
                    for parameters.
:param terminal_width: the width of the terminal.  The default is
                       inherit from parent context.  If no context
                       defines the terminal width then auto
                       detection will be applied.
:param max_content_width: the maximum width for content rendered by
                          Click (this currently only affects help
                          pages).  This defaults to 80 characters if
                          not overridden.  In other words: even if the
                          terminal is larger than that, Click will not
                          format things wider than 80 characters by
                          default.  In addition to that, formatters might
                          add some safety mapping on the right.
:param resilient_parsing: if this flag is enabled then Click will
                          parse without any interactivity or callback
                          invocation.  Default values will also be
                          ignored.  This is useful for implementing
                          things such as completion support.
:param allow_extra_args: if this is set to `True` then extra arguments
                         at the end will not raise an error and will be
                         kept on the context.  The default is to inherit
                         from the command.
:param allow_interspersed_args: if this is set to `False` then options
                                and arguments cannot be mixed.  The
                                default is to inherit from the command.
:param ignore_unknown_options: instructs click to ignore options it does
                               not know and keeps them for later
                               processing.
:param help_option_names: optionally a list of strings that define how
                          the default help parameter is named.  The
                          default is ``['--help']``.
:param token_normalize_func: an optional function that is used to
                             normalize tokens (options, choices,
                             etc.).  This for instance can be used to
                             implement case insensitive behavior.
:param color: controls if the terminal supports ANSI colors or not.  The
              default is autodetection.  This is only needed if ANSI
              codes are used in texts that Click prints which is by
              default not the case.  This for instance would affect
              help output.
:param show_default: Show the default value for commands. If this
    value is not set, it defaults to the value from the parent
    context. ``Command.show_default`` overrides this default for the
    specific command.

.. versionchanged:: 8.1
    The ``show_default`` parameter is overridden by
    ``Command.show_default``, instead of the other way around.

.. versionchanged:: 8.0
    The ``show_default`` parameter defaults to the value from the
    parent context.

.. versionchanged:: 7.1
   Added the ``show_default`` parameter.

.. versionchanged:: 4.0
    Added the ``color``, ``ignore_unknown_options``, and
    ``max_content_width`` parameters.

.. versionchanged:: 3.0
    Added the ``allow_extra_args`` and ``allow_interspersed_args``
    parameters.

.. versionchanged:: 2.0
    Added the ``resilient_parsing``, ``help_option_names``, and
    ``token_normalize_func`` parameters.
r   formatter_classNr7   r2   parent	info_nameobjauto_envvar_prefixdefault_mapterminal_widthmax_content_widthresilient_parsingallow_extra_argsallow_interspersed_argsignore_unknown_optionshelp_option_namestoken_normalize_funccolorshow_defaultr1   c                 `   X l         Xl        X0l        0 U l        / U l        / U l        U(       a  [        UR                  5      O	[        5       U l        Uc  Ub  UR                  nX@l        [        US0 5      U l
        Uc.  Ub+  Ub(  UR                  b  UR                  R                  U5      nX`l        S U l        Uc  Ub  UR                  nXpl        Uc  Ub  UR                  nXl        U
c  UR                   n
Xl        Uc  UR"                  nXl        Uc  UR$                  nXl        Uc  Ub  UR&                  nOS/nXl        Uc  Ub  UR(                  nUU l        Xl        UcG  UbC  UR,                  b6  U R                  b)  UR,                   SU R                  R/                  5        3nOUR/                  5       nUb  UR1                  SS5      nXPl        Uc  Ub  UR2                  nXl        Uc  Ub  UR4                  nUU l        / U l        SU l        0 U l        [=        5       U l        g )Nmetaz--help_-r   ) r   r7   r   paramsargsprotected_argsset_opt_prefixesr   getattr_metar   getinvoked_subcommandr   r   r   r   r   r   r   r   r   upperreplacer   r   _close_callbacks_depth_parameter_sourcer   _exit_stack)selfr7   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s                    r>   __init__Context.__init__  su   ( " +-!#	
 ,.FLV-A-A)BRURW;6-**C )0)D
 %""". ,,00;KEP 48!f&8#22N 0>$); & 8 8 3D#&77 !1"*&-&E&E# .E$!)%,%C%C" -C#$!$*$<$<!%-J! /@'F,>#)#>#> 
 ! 	! (9
 %"--9NN. 0014>>3G3G3I2JK # "4!9!9!;)!3!;!;C!E3E=V/LLE (-
F$6!..L /;?A?A$;rL   c                     U R                   R                  U 5      U R                  U R                  U R                  U R
                  U R                  S.$ )zGather information that could be useful for a tool generating
user-facing documentation. This traverses the entire CLI
structure.

.. code-block:: python

    with Context(cli) as ctx:
        info = ctx.to_info_dict()

.. versionadded:: 8.0
)r7   r   r   r   r   r   )r7   to_info_dictr   r   r   r   r   r   s    r>   r   Context.to_info_dict  sK     ||006 $ 5 5'+'C'C&*&A&A"&"9"9
 	
rL   c                 F    U =R                   S-  sl         [        U 5        U $ Nr   )r   r   r   s    r>   	__enter__Context.__enter__  s    qTrL   exc_type	exc_valuetbc                     U =R                   S-  sl         U R                   S:X  a  U R                  5         [        5         g Nr   r   )r   closer   )r   r   r   r   s       r>   __exit__Context.__exit__  s,     	q;;!JJLrL   cleanupc              #     #    U(       d  U =R                   S-  sl          U  nUv   SSS5        U(       d  U =R                   S-  sl         gg! , (       d  f       N,= f! U(       d  U =R                   S-  sl         f f = f7f)a  This helper method can be used with the context object to promote
it to the current thread local (see :func:`get_current_context`).
The default behavior of this is to invoke the cleanup functions which
can be disabled by setting `cleanup` to `False`.  The cleanup
functions are typically used for things such as closing file handles.

If the cleanup is intended the context object can also be directly
used as a context manager.

Example usage::

    with ctx.scope():
        assert get_current_context() is ctx

This is equivalent::

    with ctx:
        assert get_current_context() is ctx

.. versionadded:: 5.0

:param cleanup: controls if the cleanup functions should be run or
                not.  The default is to run these functions.  In
                some situations the context only wants to be
                temporarily pushed in which case this can be disabled.
                Nested pushes automatically defer the cleanup.
r   N)r   )r   r   rvs      r>   scopeContext.scope  sd     : KK1K	!  q    q  s1   B A AA B 
AA A==B c                     U R                   $ )a  This is a dictionary which is shared with all the contexts
that are nested.  It exists so that click utilities can store some
state here if they need to.  It is however the responsibility of
that code to manage this dictionary well.

The keys are supposed to be unique dotted strings.  For instance
module paths are a good choice for it.  What is stored in there is
irrelevant for the operation of click.  However what is important is
that code that places data here adheres to the general semantics of
the system.

Example usage::

    LANG_KEY = f'{__name__}.lang'

    def set_language(value):
        ctx = get_current_context()
        ctx.meta[LANG_KEY] = value

    def get_language():
        return get_current_context().meta.get(LANG_KEY, 'en_US')

.. versionadded:: 5.0
)r   r   s    r>   r   Context.meta  s    4 zzrL   c                 J    U R                  U R                  U R                  S9$ )a  Creates the :class:`~click.HelpFormatter` for the help and
usage output.

To quickly customize the formatter class used without overriding
this method, set the :attr:`formatter_class` attribute.

.. versionchanged:: 8.0
    Added the :attr:`formatter_class` attribute.
)width	max_width)r   r   r   r   s    r>   make_formatterContext.make_formatter   s-     ##%%1G1G $ 
 	
rL   context_managerc                 8    U R                   R                  U5      $ )aA  Register a resource as if it were used in a ``with``
statement. The resource will be cleaned up when the context is
popped.

Uses :meth:`contextlib.ExitStack.enter_context`. It calls the
resource's ``__enter__()`` method and returns the result. When
the context is popped, it closes the stack, which calls the
resource's ``__exit__()`` method.

To register a cleanup function for something that isn't a
context manager, use :meth:`call_on_close`. Or use something
from :mod:`contextlib` to turn it into a context manager first.

.. code-block:: python

    @click.group()
    @click.option("--name")
    @click.pass_context
    def cli(ctx):
        ctx.obj = ctx.with_resource(connect_db(name))

:param context_manager: The context manager to enter.
:return: Whatever ``context_manager.__enter__()`` returns.

.. versionadded:: 8.0
)r   enter_context)r   r   s     r>   with_resourceContext.with_resource.  s    6 --o>>rL   f.c                 8    U R                   R                  U5      $ )aU  Register a function to be called when the context tears down.

This can be used to close resources opened during the script
execution. Resources that support Python's context manager
protocol which would be used in a ``with`` statement should be
registered with :meth:`with_resource` instead.

:param f: The function to execute on teardown.
)r   callback)r   r   s     r>   call_on_closeContext.call_on_closeK  s     ((++rL   c                 V    U R                   R                  5         [        5       U l         g)zInvoke all close callbacks registered with
:meth:`call_on_close`, and exit all context managers entered
with :meth:`with_resource`.
N)r   r   r   r   s    r>   r   Context.closeW  s     
 	 $;rL   c                    SnU R                   b  U R                   nU R                  b  U R                  R                  /n[        U R                  R                  [
        5      (       aL  U R                  R                  R                  U 5       H#  nUR                  UR                  U 5      5        M%     SR                  U5       SU 3nUR                  5       $ )zThe computed command path.  This is used for the ``usage``
information on the help page.  It's automatically created by
combining the info names of the chain of contexts to the root.
  )r   r   command_pathrF   r7   r2   
get_paramsextendget_usage_piecesjoinlstrip)r   r   parent_command_pathrU   s       r>   r   Context.command_path`  s     >>%B;;"#';;#;#;"<$++--w77![[00;;DAE'..u/E/Ed/KL B HH012!B48Byy{rL   c                 Z    U nUR                   b  UR                   nUR                   b  M  U$ )zFinds the outermost context.r   )r   nodes     r>   	find_rootContext.find_roots  s+    kk%;;D kk%rL   object_typec                 ~    U nUb8  [        UR                  U5      (       a  UR                  $ UR                  nUb  M8  g)z)Finds the closest object of a given type.N)rF   r   r   )r   r   r   s      r>   find_objectContext.find_objectz  s=    $($((K00xx;;D	  rL   c                 J    U R                  U5      nUc  U" 5       =U l        nU$ )zpLike :meth:`find_object` but sets the innermost object to a
new instance of `object_type` if it does not exist.
)r   r   )r   r   r   s      r>   ensure_objectContext.ensure_object  s,     k*:'M)DHr	rL   r=   callte.Literal[True]c                     g rP   rp   r   r=   r   s      r>   lookup_defaultContext.lookup_default        rL   zte.Literal[False]c                     g rP   rp   r   s      r>   r   r          =@rL   c                     U R                   b;  U R                   R                  U5      nU(       a  [        U5      (       a  U" 5       $ U$ g)zGet the default for a parameter from :attr:`default_map`.

:param name: Name of the parameter.
:param call: If the default is a callable, call it. Disable to
    return the callable instead.

.. versionchanged:: 8.0
    Added the ``call`` parameter.
N)r   r   callable)r   r=   r   values       r>   r   r     s@     '$$((.EwLrL   messagete.NoReturnc                     [        X5      e)ztAborts the execution of the program with a specific error
message.

:param message: the error message to fail with.
r   )r   r   s     r>   failContext.fail  s     ''rL   c                     [        5       e)zAborts the script.r   r   s    r>   abortContext.abort  s	    grL   codec                     [        U5      e)z-Exits the application with a given exit code.r   )r   r   s     r>   exitContext.exit  s    4jrL   c                 8    U R                   R                  U 5      $ )zQHelper method to get formatted usage string for the current
context and command.
)r7   	get_usager   s    r>   r   Context.get_usage  s     ||%%d++rL   c                 8    U R                   R                  U 5      $ )zNHelper method to get formatted help page for the current
context and command.
)r7   get_helpr   s    r>   r   Context.get_help  s     ||$$T**rL   c                 6    [        U 5      " XR                  U S9$ )z^Create a new context of the same type as this context, but
for a new command.

:meta private:
r   r   )rH   r=   )r   r7   s     r>   _make_sub_contextContext._make_sub_context  s     Dz'\\$GGrL   _Context__callbackt.Callable[..., V]r   kwargsc                     g rP   rp   _Context__selfr  r   r  s       r>   invokeContext.invoke  s     rL   c                     g rP   rp   r
  s       r>   r  r    s     rL   )r2   r  c                 r   [        U[        5      (       a  UnUR                  c  [        S5      e[        R
                  " SUR                  5      nU R                  U5      nUR                   HT  nUR                  U;  d  M  UR                  (       d  M(  UR                  XVR                  U5      5      X6R                  '   MV     UR                  R                  U5        OU n[        U 5         U   U" U0 UD6sSSS5        sSSS5        $ ! , (       d  f       O= f SSS5        g! , (       d  f       g= f)aX  Invokes a command callback in exactly the way it expects.  There
are two ways to invoke this method:

1.  the first argument can be a callback and all other arguments and
    keyword arguments are forwarded directly to the function.
2.  the first argument is a click command object.  In that case all
    arguments are forwarded as well but proper click parameters
    (options and click arguments) must be keyword arguments and Click
    will fill in defaults.

Note that before Click 3.2 keyword arguments were not properly filled
in against the intention of this code and no context was created.  For
more information about this change and why it was done in a bugfix
release see :ref:`upgrade-to-3.2`.

.. versionchanged:: 8.0
    All ``kwargs`` are tracked in :attr:`params` so they will be
    passed if :meth:`forward` is called at multiple levels.
Nz?The given command does not have a callback that can be invoked.r  )rF   r2   r   	TypeErrorr4   r5   r  r   r=   expose_valuetype_cast_valueget_defaultupdaterY   )r  r  r   r  	other_cmdr.   rU   s          r>   r  r    s    2 j'**"I!!)U  VV$8):L:LM
**95C"))::V+0B0B0B).)>)>..s3*F::& * JJf%C!&)!4262  *) *))s$   /D(2D:	D(
D	D((
D6_Context__cmdc                     [        U[        5      (       d  [        S5      eU R                   H  nXC;  d  M
  U R                  U   X4'   M     U R                  " U/UQ70 UD6$ )aJ  Similar to :meth:`invoke` but fills in default keyword
arguments from the current context if the other command expects
it.  This cannot invoke callbacks directly, only other commands.

.. versionchanged:: 8.0
    All ``kwargs`` are tracked in :attr:`params` so they will be
    passed if ``forward`` is called at multiple levels.
zCallback is not a command.)rF   r2   r  r   r  )r  r  r   r  rU   s        r>   forwardContext.forward  s\     %))899]]E" &e 4 # }}U4T4V44rL   sourcec                      X R                   U'   g)zSet the source of a parameter. This indicates the location
from which the value of the parameter was obtained.

:param name: The name of the parameter.
:param source: A member of :class:`~click.core.ParameterSource`.
N)r   )r   r=   r  s      r>   set_parameter_sourceContext.set_parameter_source)  s     (.t$rL   c                 8    U R                   R                  U5      $ )a   Get the source of a parameter. This indicates the location
from which the value of the parameter was obtained.

This can be useful for determining when a user specified a value
on the command line that is the same as the default value. It
will be :attr:`~click.core.ParameterSource.DEFAULT` only if the
value was actually taken from the default.

:param name: The name of the parameter.
:rtype: ParameterSource

.. versionchanged:: 8.0
    Returns ``None`` if the parameter was not provided from any
    source.
)r   r   )r   r=   s     r>   get_parameter_sourceContext.get_parameter_source2  s      %%))$//rL   )r   r   r   r   r   r   r   r   r   r   r   r7   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )NNNNNNNFNNNNNNN)r1   r/   T)r1   N.)r1   r   )r   )r7   r2   r1   r/   )7rI   rq   rr   rs   rt   r   r   r4   Type__annotations__OptionalstrAnyMutableMappingintrj   ListCallabler   Dictr   r   BaseExceptionr
   r   r   Iteratorr   propertyr   r   ContextManagerr-   r   r   r   r   r   r   r   overloadr   Unionr   r   r   r   r   r  r  r  rn   r  r  r|   rp   rL   r>   r/   r/      s   \B 0=OQVVO,<
 )-%)!%.2@D*.-1"'-1483759CG"&)-#j'j' 

9%j' ::c?	j'
 ZZj' JJsOj' ZZ 0 0aee <=j' 

3j' ::c?j'  j' **T*j' "#D!1j' !"

4 0j' ::affSk2j'  jjSE3J)?@j'  zz$!j'" jj&#j'$ 
%j'X
affS!%%Z0 
*
	**QVVM23	 ::m,	 JJ}%		
 
	 #!T #!QZZ	-B #! #!J affS!%%Z(  6
 
?Q-=-=a-@ ?Q ?:
,qzz#quu*5 
,!**S!%%Z:P 
,' c  $
qvvay 
QZZ] 
 q  ZZ48  1 	
AEE	    ZZ58@@2@	
AGGAEE1::b!%%i#889	:@ @3 d ajj>O ((C (M ( ] ,3 ,+# +H ZZ( uu %%	
 
  ZZ uu %%	
 
 33GG;<33 uu33 %%	33
 
	33j5y 5 5!%% 5AEE 5&. .o .$ .0 0O1L 0rL   c                      \ rS rSr% Sr\r\R                  \   \	S'   Sr
SrSr S(S\R                  \   S\R                  \R                  \\R                   4      S	S4S
 jjrS\S	\R$                  \\R                   4   4S jrS	\4S jrS\S	\4S jrS\S	\4S jr S(S\R                  \   S\R.                  \   S\R                  \   S\R                   S	\4
S jjrS\S\R.                  \   S	\R.                  \   4S jrS\S	\R                   4S jrS\S\S	\R.                  S   4S jr\R8                      S)S\R                  \R:                  \      S\R                  \   S\R                  \   SSS\R                   S	S4S jj5       r\R8                      S*S\R                  \R:                  \      S\R                  \   S\R                  \   S\S\R                   S	\R                   4S  jj5       r     S+S\R                  \R:                  \      S\R                  \   S\R                  \   S\S!\S\R                   S	\R                   4S" jjr S(S#\R                  \\R                   4   S\S\R                  \   S	S4S$ jjr S\R                   S%\R                   S	\R                   4S& jr!S'r"g),BaseCommandiE  ae  The base command implements the minimal API contract of commands.
Most code will never use this as it does not implement a lot of useful
functionality but it can act as the direct subclass of alternative
parsing methods that do not depend on the Click parser.

For instance, this can be used to bridge Click and other systems like
argparse or docopt.

Because base commands do not implement a lot of the API that other
parts of Click take for granted, they are not supported for all
operations.  For instance, they cannot be used with the decorators
usually and they have no built-in callback system.

.. versionchanged:: 2.0
   Added the `context_settings` parameter.

:param name: the name of the command to use unless a group overrides it.
:param context_settings: an optional dictionary with defaults that are
                         passed to the context object.
context_classFTNr=   context_settingsr1   c                 &    Xl         Uc  0 nX l        g rP   )r=   r6  )r   r=   r6  s      r>   r   BaseCommand.__init__f  s     	#! ?OrL   r.   c                     SU R                   0$ )a1  Gather information that could be useful for a tool generating
user-facing documentation. This traverses the entire structure
below this command.

Use :meth:`click.Context.to_info_dict` to traverse the entire
CLI structure.

:param ctx: A :class:`Context` representing this command.

.. versionadded:: 8.0
r=   r=   r   r.   s     r>   r   BaseCommand.to_info_dictw  s     		""rL   c                 P    SU R                   R                   SU R                   S3$ N<r   >	__class__rI   r=   r   s    r>   __repr__BaseCommand.__repr__  &    4>>**+1TYYKq99rL   c                     [        S5      e)NzBase commands cannot get usageNotImplementedErrorr;  s     r>   r   BaseCommand.get_usage  s    !"BCCrL   c                     [        S5      e)NzBase commands cannot get helprG  r;  s     r>   r   BaseCommand.get_help  s    !"ABBrL   r   r   r   extrac                    U R                   R                  5        H  u  pVXT;  d  M  XdU'   M     U R                  " U 4UUS.UD6nUR                  SS9   U R	                  Xr5        SSS5        U$ ! , (       d  f       U$ = f)a^  This function when given an info name and arguments will kick
off the parsing and create a new :class:`Context`.  It does not
invoke the actual command callback though.

To quickly customize the context class used without overriding
this method, set the :attr:`context_class` attribute.

:param info_name: the info name for this invocation.  Generally this
                  is the most descriptive name for the script or
                  command.  For the toplevel script it's usually
                  the name of the script, for commands below it's
                  the name of the command.
:param args: the arguments to parse as list of strings.
:param parent: the parent context if available.
:param extra: extra keyword arguments forwarded to the context
              constructor.

.. versionchanged:: 8.0
    Added the :attr:`context_class` attribute.
r  Fr   N)r6  itemsr5  r   
parse_args)r   r   r   r   rL  rh   r   r.   s           r>   make_contextBaseCommand.make_context  s    6 //557JC"c
 8   

 	
 YYuY%OOC& &
 &%
s   A00
A?c                     [        S5      e)zGiven a context and a list of arguments this creates the parser
and parses the arguments, then modifies the context as necessary.
This is automatically invoked by :meth:`make_context`.
z1Base commands do not know how to parse arguments.rG  )r   r.   r   s      r>   rP  BaseCommand.parse_args  s    
 ""UVVrL   c                     [        S5      e)zkGiven a context, this invokes the command.  The default
implementation is raising a not implemented error.
z*Base commands are not invocable by defaultrG  r;  s     r>   r  BaseCommand.invoke  s     ""NOOrL   r0   r*   c                 *  ^^ SSK Jm  / nTR                  b{  TR                  m[        TR                  [
        5      (       aA  TR                  R                  (       a&  UR                  UU4S j[        TU5       5       5        TR                  b  M{  U$ )a  Return a list of completions for the incomplete value. Looks
at the names of chained multi-commands.

Any command could be part of a chained multi-command, so sibling
commands are valid at any point during command completion. Other
command classes will return more completions.

:param ctx: Invocation context for this command.
:param incomplete: Value being completed. May be empty.

.. versionadded:: 8.0
r   r)   c              3   r   >#    U H-  u  pUTR                   ;  d  M  T" XR                  5       S 9v   M/     g7fhelpN)r   get_short_help_str).0r=   r7   r*   r.   s      r>   	<genexpr>-BaseCommand.shell_complete.<locals>.<genexpr>  s9      )T3#5#55 LN4.H.H.JK)Ts   77)	click.shell_completionr*   r   rF   r7   r6   rE   r   r?   )r   r.   r0   resultsr*   s    `  @r>   shell_completeBaseCommand.shell_complete  sp     	:*,jj$**C#++|449J9J )CC)T 	 jj$ rL   	prog_namecomplete_varstandalone_moder   r   c                     g rP   rp   r   r   rd  re  rf  rL  s         r>   mainBaseCommand.main  s     rL   c                     g rP   rp   rh  s         r>   ri  rj    s     rL   windows_expand_argsc                 r   Uc:  [         R                  SS n[        R                  S:X  a  U(       a  [	        U5      nO[        U5      nUc
  [        5       nU R                  XbU5          U R                  " X!40 UD6 nU R                  U5      nU(       d  UsSSS5        $ UR                  5         SSS5        g! , (       d  f       g= f! [        [        4 a'  n	[        [         R                  S9  [        5       U	eSn	A	f[          aB  n	U(       d  e U	R#                  5         [         R                  " U	R$                  5         Sn	A	gSn	A	f[&         a  n	U	R(                  [(        R*                  :X  a  [,        R.                  " [,        R0                  [3        [         R4                  5      5      [         l        [,        R.                  " [,        R0                  [3        [         R                  5      5      [         l        [         R                  " S5         Sn	A	ge Sn	A	ff = f! [6         aB  n	U(       a%  [         R                  " U	R$                  5         Sn	A	gU	R$                  s Sn	A	$ Sn	A	f[         aB    U(       d  e [        [9        S5      [         R                  S9  [         R                  " S5         gf = f)a  This is the way to invoke a script with all the bells and
whistles as a command line application.  This will always terminate
the application after a call.  If this is not wanted, ``SystemExit``
needs to be caught.

This method is also available by directly calling the instance of
a :class:`Command`.

:param args: the arguments that should be used for parsing.  If not
             provided, ``sys.argv[1:]`` is used.
:param prog_name: the program name that should be used.  By default
                  the program name is constructed by taking the file
                  name from ``sys.argv[0]``.
:param complete_var: the environment variable that controls the
                     bash completion support.  The default is
                     ``"_<prog_name>_COMPLETE"`` with prog_name in
                     uppercase.
:param standalone_mode: the default behavior is to invoke the script
                        in standalone mode.  Click will then
                        handle exceptions and convert them into
                        error messages and the function will never
                        return but shut down the interpreter.  If
                        this is set to `False` they will be
                        propagated to the caller and the return
                        value of this function is the return value
                        of :meth:`invoke`.
:param windows_expand_args: Expand glob patterns, user dir, and
    env vars in command line args on Windows.
:param extra: extra keyword arguments are forwarded to the context
              constructor.  See :class:`Context` for more information.

.. versionchanged:: 8.0.1
    Added the ``windows_expand_args`` parameter to allow
    disabling command line arg expansion on Windows.

.. versionchanged:: 8.0
    When taking arguments from ``sys.argv`` on Windows, glob
    patterns, user dir, and env vars are expanded.

.. versionchanged:: 3.0
   Added the ``standalone_mode`` parameter.
Nr   nt)filezAborted!)sysargvosr=   r"   rQ   r!   _main_shell_completionrQ  r  r   EOFErrorKeyboardInterruptr#   stderrr   r   show	exit_codeOSErrorerrnoEPIPEr4   r5   TextIOr&   stdoutr   r   )
r   r   rd  re  rf  rl  rL  r.   r   rX   s
             r>   ri  rj    s   f <88AB<Dww$#6#D):D,.I 	##ElC.	&&y@%@CS)B*! A@ HHJ A@@ /0 %#**%g1$! &&%% 77ekk)!"2DSZZ2P!QCJ!"2DSZZ2P!QCJHHQKK  	#%% {{" 	":SZZ0HHQK		s   *C =B:	C !B:1C :
CC C H"C==H
8EH  HB>HH  HHH   
J6*'I'I'!J6'AJ65J6ctx_argsc                    Uc6  UR                  SS5      R                  SS5      nSU S3R                  5       n[        R                  R	                  U5      nU(       d  gSSKJn  U" XX#U5      n[        R                  " U5        g)a  Check if the shell is asking for tab completion, process
that, then exit early. Called from :meth:`main` before the
program is invoked.

:param prog_name: Name of the executable in the shell.
:param complete_var: Name of the environment variable that holds
    the completion instruction. Defaults to
    ``_{PROG_NAME}_COMPLETE``.

.. versionchanged:: 8.2.0
    Dots (``.``) in ``prog_name`` are replaced with underscores (``_``).
Nr   r   .	_COMPLETEr   )rb  )	r   r   rr  environr   shell_completionrb  rp  r   )r   r~  rd  re  complete_nameinstructionrb  r   s           r>   rs  "BaseCommand._main_shell_completiong  st    $ %--c37??SIM}oY7==?Ljjnn\24DI[QrL   r  c                 &    U R                   " U0 UD6$ )zAlias for :meth:`main`.)ri  r   r   r  s      r>   __call__BaseCommand.__call__  s    yy$)&))rL   )r6  r=   rP   )NNNT)NNN.)NNNTT)#rI   rq   rr   rs   rt   r/   r5  r4   r#  r$  r   r   r   r%  r&  r(  r'  r   r,  r   rC  r   r   r*  rQ  rP  r  rb  r1  Sequenceri  rj   rs  r  r|   rp   rL   r>   r4  r4  E  s   0 &-M166'?,""
 FJOjjoO **Q%5%5c155j%ABO 
	O"# #AFF3:,> #:# :DW D DCG C C '+	(::c?( ffSk( 

7#	(
 ( 
(TWg WQVVC[ WQVVC[ WP' Paee P' s qvvFV?W : ZZ -1%)(,.2jjC) ::c? jjo	
 ,  
  ZZ -1%)(, #jjC) ::c? jjo	
   
  -1%)(, $$(ojjC)o ::c?o jjo	o
 o "o o 
oj )-	""3:.  jjo	
 
@*aee *quu * *rL   r4  c                   &  ^  \ rS rSrSr           S-S\R                  \   S\R                  \R                  \\R                  4      S\R                  \R                  S\R                  4      S\R                  \R                  S	      S
\R                  \   S\R                  \   S\R                  \   S\R                  \   S\S\S\S\SS4U 4S jjjrS\S\R                  \\R                  4   4U 4S jjrS\S\4S jrS\S\R                  S	   4S jrS\S\SS4S jrS\S\R                  \   4S jrS\S\R                  \   4S jrS\S\R                  S   4S jrS\S\4S jrS\S\4S jrS.S \S\4S! jjrS\S\SS4S" jrS\S\SS4S# jrS\S\SS4S$ jrS\S\SS4S% jr S\S&\R                  \   S\R                  \   4S' jr!S\S\R                  4S( jr"S\S)\S\R                  S*   4U 4S+ jjr#S,r$U =r%$ )/r2   i  aj  Commands are the basic building block of command line interfaces in
Click.  A basic command handles command line parsing and might dispatch
more parsing to commands nested below it.

:param name: the name of the command to use unless a group overrides it.
:param context_settings: an optional dictionary with defaults that are
                         passed to the context object.
:param callback: the callback to invoke.  This is optional.
:param params: the parameters to register with this command.  This can
               be either :class:`Option` or :class:`Argument` objects.
:param help: the help string to use for this command.
:param epilog: like the help string but it's printed at the end of the
               help page after everything else.
:param short_help: the short help to use for this command.  This is
                   shown on the command listing of the parent command.
:param add_help_option: by default each command registers a ``--help``
                        option.  This can be disabled by this parameter.
:param no_args_is_help: this controls what happens if no arguments are
                        provided.  This option is disabled by default.
                        If enabled this will add ``--help`` as argument
                        if no arguments are passed
:param hidden: hide this command from help outputs.

:param deprecated: issues a message indicating that
                         the command is deprecated.

.. versionchanged:: 8.1
    ``help``, ``epilog``, and ``short_help`` are stored unprocessed,
    all formatting is done when outputting help text, not at init,
    and is done even if not using the ``@command`` decorator.

.. versionchanged:: 8.0
    Added a ``repr`` showing the command name.

.. versionchanged:: 7.1
    Added the ``no_args_is_help`` parameter.

.. versionchanged:: 2.0
    Added the ``context_settings`` parameter.
Nr=   r6  r   .r   rV   r[  epilog
short_helpoptions_metavaradd_help_optionno_args_is_helpr;   
deprecatedr1   c                    > [         TU ]  X5        X0l        U=(       d    / U l        XPl        X`l        Xl        Xpl        Xl        S U l	        Xl
        Xl        Xl        g rP   )superr   r   r   r[  r  r  r  r  _help_optionr  r;   r  )r   r=   r6  r   r   r[  r  r  r  r  r  r;   r  rB  s                r>   r   Command.__init__  sY     	0 ! *02	.$.48.$rL   r.   c           	        > [         TU ]  U5      nUR                  U R                  U5       Vs/ sH  o3R                  5       PM     snU R                  U R
                  U R                  U R                  U R                  S9  U$ s  snf )N)r   r[  r  r  r;   r  )	r  r   r  r   r[  r  r  r;   r  )r   r.   	info_dictrU   rB  s       r>   r   Command.to_info_dict  sz    G(-	6:ooc6JK6JU&&(6JK;;;; 	 	
  Ls   Bc                     UR                  5       nU R                  X5        UR                  5       R                  S5      $ )z]Formats the usage line into a string and returns it.

Calls :meth:`format_usage` internally.

)r   format_usagegetvaluerstripr   r.   	formatters      r>   r   Command.get_usage  s:    
 &&(	#)!!#**400rL   c                 R    U R                   nU R                  U5      nUb  / UQUPnU$ rP   )r   get_help_option)r   r.   r   help_options       r>   r   Command.get_params  s5    [[**3/"#2#{#B	rL   r  c                 |    U R                  U5      nUR                  UR                  SR                  U5      5        g)zcWrites the usage line into the formatter.

This is a low-level method called by :meth:`get_usage`.
r   N)collect_usage_pieceswrite_usager   r   )r   r.   r  piecess       r>   r  Command.format_usage  s3    
 **3/c..0@ArL   c                     U R                   (       a  U R                   /O/ nU R                  U5       H#  nUR                  UR                  U5      5        M%     U$ )zXReturns all the pieces that go into the usage line and returns
it as a list of strings.
)r  r   r   r   )r   r.   r   rU   s       r>   r  Command.collect_usage_pieces  sM     (,';';d""#__S)EIIe,,S12 * 	rL   c                     [        UR                  5      nU R                   H9  nUR                  UR                  5        UR                  UR
                  5        M;     [        U5      $ )z&Returns the names for the help option.)r   r   r   difference_updateoptssecondary_optsrQ   )r   r.   	all_namesrU   s       r>   get_help_option_namesCommand.get_help_option_names  sR    --.	[[E''

3''(<(<= ! IrL   Optionc                     U R                  U5      nU(       a  U R                  (       d  gU R                  c  SSKJn  U" U5      U l        U R                  $ )zReturns the help option object.

Unless ``add_help_option`` is ``False``.

.. versionchanged:: 8.1.8
    The help option is now cached to avoid creating it multiple times.
Nr   r'   )r  r  r  
decoratorsr(   )r   r.   help_optionsr(   s       r>   r  Command.get_help_option  sL     11#64#7#7 $. *< 8D   rL   c                 n    [        U5      nU R                  U5       H  nUR                  X!5        M     U$ )z6Creates the underlying option parser for this command.)r   r   add_to_parser)r   r.   parserrU   s       r>   make_parserCommand.make_parser)  s2    c"__S)E, *rL   c                     UR                  5       nU R                  X5        UR                  5       R                  S5      $ )zVFormats the help into a string and returns it.

Calls :meth:`format_help` internally.
r  )r   format_helpr  r  r  s      r>   r   Command.get_help0  s:    
 &&(	(!!#**400rL   limitc                 ,   U R                   (       a!  [        R                  " U R                   5      nO*U R                  (       a  [	        U R                  U5      nOSnU R
                  (       a  [        S5      R                  US9nUR                  5       $ )zPGets short help for the command or makes it by shortening the
long help string.
r   (Deprecated) {text}text)	r  inspectcleandocr[  r$   r  r   formatstrip)r   r  r  s      r>   r\  Command.get_short_help_str9  sg     ??##DOO4DYY*499e<DD??*+222=Dzz|rL   c                     U R                  X5        U R                  X5        U R                  X5        U R                  X5        g)zWrites the help into the formatter if it exists.

This is a low-level method called by :meth:`get_help`.

This calls the following methods:

-   :meth:`format_usage`
-   :meth:`format_help_text`
-   :meth:`format_options`
-   :meth:`format_epilog`
N)r  format_help_textformat_optionsformat_epilogr  s      r>   r  Command.format_helpI  s<     	#)c-C+3*rL   c                    U R                   b3  [        R                  " U R                   5      R                  S5      S   nOSnU R                  (       a  [        S5      R                  US9nU(       a;  UR                  5         UR                  5          UR                  U5        SSS5        gg! , (       d  f       g= f)z3Writes the help text to the formatter if it exists.Nr   r   r  r  )
r[  r  r  	partitionr  r   r  write_paragraphindentation
write_text)r   r.   r  r  s       r>   r  Command.format_help_textZ  s    99 ##DII.88>qADD??*+222=D%%'&&($$T* )(  )(s   B//
B=c                     / nU R                  U5       H*  nUR                  U5      nUc  M  UR                  U5        M,     U(       a5  UR                  [	        S5      5         UR                  U5        SSS5        gg! , (       d  f       g= f)z8Writes all the options into the formatter if they exist.NOptions)r   get_help_recordappendsectionr   write_dl)r   r.   r  r  rU   r   s         r>   r  Command.format_optionsk  ss    __S)E&&s+B~B *
 ""1Y<0""4( 10 00s   #A??
Bc                     U R                   (       a[  [        R                  " U R                   5      nUR                  5         UR	                  5          UR                  U5        SSS5        gg! , (       d  f       g= f)z2Writes the epilog into the formatter if it exists.N)r  r  r  r  r  r  )r   r.   r  r  s       r>   r  Command.format_epilogw  sY    ;;%%dkk2F%%'&&($$V, )(	  )(s   A..
A<r   c           
         U(       dT  U R                   (       aC  UR                  (       d2  [        UR                  5       UR                  S9  UR                  5         U R                  U5      nUR                  US9u  pBn[        XPR                  U5      5       H  nUR                  XU5      u  prM     U(       aq  UR                  (       d`  UR                  (       dO  UR                  [        SS[        U5      5      R                  SR!                  [#        [$        U5      5      S95        X!l        UR(                  R+                  UR(                  5        U$ )Nr   )r   z&Got unexpected extra argument ({args})z'Got unexpected extra arguments ({args})r   )r  r   r#   r   r   r   r  rP  rl   r   handle_parse_resultr   r   r   lenr  r   mapr&  r   r   r  )r   r.   r   r  r  param_orderrU   r   s           r>   rP  Command.parse_args  s   ,,S5J5Jsyy1HHJ!!#&"("3"3"3">K/__S=QRE33CtDKE4 S ,,S5J5JHH<=I &chhs3~6&7   !5!56rL   c                     U R                   (       a4  [        S5      R                  U R                  S9n[	        [        USS9SS9  U R                  b'  UR                  " U R                  40 UR                  D6$ g)zUGiven a context, this invokes the attached callback (if it exists)
in the right way.
z7DeprecationWarning: The command {name!r} is deprecated.r:  red)fgT)errN)	r  r   r  r=   r#   r    r   r  r   )r   r.   r   s      r>   r  Command.invoke  si     ??If$))f$  w5)t4==$::dmm:szz:: %rL   r0   r*   c                   >^^^ SSK Jm  / nT(       a  TS   R                  5       (       d  U R                  U5       H  m[	        T[
        5      (       aN  TR                  (       d=  TR                  (       d.  UR                  TR                  5      [        R                  L a  Mh  UR                  UUU4S j/ TR                  QTR                  Q 5       5        M     UR                  [        TU ]A  UT5      5        U$ )zReturn a list of completions for the incomplete value. Looks
at the names of options and chained multi-commands.

:param ctx: Invocation context for this command.
:param incomplete: Value being completed. May be empty.

.. versionadded:: 8.0
r   r)   c              3   t   >#    U H.  nUR                  T5      (       d  M  T" UTR                  S 9v   M0     g7frY  )r9   r[  )r]  r=   r*   r0   rU   s     r>   r^  )Command.shell_complete.<locals>.<genexpr>  s1       Dz2 :N4ejj9 Ds   88)r`  r*   isalnumr   rF   r  r;   multipler  r=   rn   rw   r   r  r  r  rb  )r   r.   r0   ra  r*   rU   rB  s     ` @@r>   rb  Command.shell_complete  s     	:*,jm3355-"5&11||!NN44UZZ@*667   D%** Du/C/C D  .$ 	uw-c:>?rL   )r  r  r   r  r  r[  r;   r  r  r   r  )NNNNNNz	[OPTIONS]TFFF)-   )&rI   rq   rr   rs   rt   r4   r%  r&  r(  r'  r+  r*  rj   r   r/   r,  r   r   r   r   r  r  r  r  r   r  r   r)  r\  r  r  r  r  rP  r  rb  r|   __classcell__rB  s   @r>   r2   r2     s   'X FJ7;26 $"&&*+6 $ % %jjo% **Q%5%5c155j%AB% **QZZQUU
34	%
 

166+./% jjo% 

3% JJsO% C% % % % % 
% %B
 
AFF3:,> 
1W 1 1g !&&*= B BM Bd B	 	AFF3K 	 QVVC[ !7 !qzz(/C !2w < 1G 1 1 S  +w += +T +"+G + +$ +"
)' 
)m 
) 
)- -] -t -g QVVC[ QVVC[ 0;' ;aee ;!' !s !qvvFV?W ! !rL   c                     ^  \ rS rSrSrSrSr      S#S\R                  \	   S\
S\R                  \
   S	\R                  \	   S
\
S\R                  \R                  S\R                  4      S\R                  SS4U 4S jjjrS\S\R                  \	\R                  4   4U 4S jjrS\S\R"                  \	   4U 4S jjrS\S\SS4U 4S jjrS$S\
S\R                  \/\4   4S jjrS\S\SS4S jrS\S\R"                  \	   S\R"                  \	   4U 4S jjrS\S\R                  4U 4S jjrS\S\R"                  \	   S\R4                  \R                  \	   \R                  \   \R"                  \	   4   4S jrS\S\	S\R                  \   4S jrS\S\R"                  \	   4S jrS\S\	S\R"                  S    4U 4S! jjrS"r U =r!$ )%r6   i  aJ  A multi command is the basic implementation of a command that
dispatches to subcommands.  The most common version is the
:class:`Group`.

:param invoke_without_command: this controls how the multi command itself
                               is invoked.  By default it's only invoked
                               if a subcommand is provided.
:param no_args_is_help: this controls what happens if no arguments are
                        provided.  This option is enabled by default if
                        `invoke_without_command` is disabled or disabled
                        if it's enabled.  If enabled this will add
                        ``--help`` as argument if no arguments are
                        passed.
:param subcommand_metavar: the string that is used in the documentation
                           to indicate the subcommand place.
:param chain: if this is set to `True` chaining of multiple subcommands
              is enabled.  This restricts the form of commands in that
              they cannot have optional arguments but it allows
              multiple commands to be chained together.
:param result_callback: The result callback to attach to this multi
    command. This can be set or changed later with the
    :meth:`result_callback` decorator.
:param attrs: Other command arguments described in :class:`Command`.
TFNr=   invoke_without_commandr  subcommand_metavarrE   result_callback.attrsr1   c                 F  > [         T	U ]  " U40 UD6  Uc  U(       + nX0l        X l        Uc  U(       a  SnOSnX@l        XPl        X`l        U R
                  (       aG  U R                   H6  n[        U[        5      (       d  M  UR                  (       a  M-  [        S5      e   g g )Nz*COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...zCOMMAND [ARGS]...z<Multi commands in chain mode cannot have optional arguments.)r  r   r  r  r  rE   _result_callbackr   rF   ArgumentrequiredrG   )
r   r=   r  r  r  rE   r  r  rU   rB  s
            r>   r   MultiCommand.__init__  s     	''""88O.&<#%%Q"%8""4
 !0::eX..u~~~&/  % rL   r.   c                 T  > [         TU ]  U5      n0 nU R                  U5       HU  nU R                  X5      nUc  M  UR	                  U5      nUR                  SS9   UR                  U5      X4'   S S S 5        MW     UR                  X0R                  S9  U$ ! , (       d  f       M  = f)NFrN  )commandsrE   )r  r   r8   r:   r  r   r  rE   )r   r.   r  r   r=   r7   sub_ctxrB  s          r>   r   MultiCommand.to_info_dict  s    G(-	&&s+D&&s1G++G4Gu-!(!5!5g!> .- , 	(**=	 .-s   B
B'	c                 \   > [         TU ]  U5      nUR                  U R                  5        U$ rP   )r  r  r  r  )r   r.   r   rB  s      r>   r  !MultiCommand.collect_usage_pieces  s)    W)#.
		$))*	rL   r  c                 F   > [         TU ]  X5        U R                  X5        g rP   )r  r  format_commands)r   r.   r  rB  s      r>   r  MultiCommand.format_options#  s    s.S,rL   r   c                 4   ^ ^ S[         S[         4UU 4S jjnU$ )a  Adds a result callback to the command.  By default if a
result callback is already registered this will chain them but
this can be disabled with the `replace` parameter.  The result
callback is invoked with the return value of the subcommand
(or the list of return values from all subcommands if chaining
is enabled) as well as the parameters as they would be passed
to the main callback.

Example::

    @click.group()
    @click.option('-i', '--input', default=23)
    def cli(input):
        return 42

    @cli.result_callback()
    def process_result(result, input):
        return result + input

:param replace: if set to `True` an already existing result
                callback will be removed.

.. versionchanged:: 8.0
    Renamed from ``resultcallback``.

.. versionadded:: 3.0
r   r1   c                    >^ ^ TR                   mTb  T(       a	  T Tl         T $ U U4S jn[        [        R                  " [        U5      T 5      =Tl         nU$ )Nc                 4   > T" U /UQ70 UD6nT" U/UQ70 UD6$ rP   rp   )_MultiCommand__valuer   r  innerr   old_callbacks       r>   functionAMultiCommand.result_callback.<locals>.decorator.<locals>.functionK  s,    $W>t>v>0000rL   )r  r   r4   r5   r+   )r   r  r   r  r   r   s   `  @r>   	decorator/MultiCommand.result_callback.<locals>.decoratorD  sN    00L#w()%1 *8q(8KQ)OOD!BIrL   )r+   )r   r   r  s   `` r>   r  MultiCommand.result_callback'  s#    :	 	q 	 	 rL   c                    / nU R                  U5       H>  nU R                  X5      nUc  M  UR                  (       a  M,  UR                  XE45        M@     [	        U5      (       a  UR
                  S-
  [        S U 5       5      -
  n/ nU H(  u  pEUR                  U5      nUR                  XH45        M*     U(       a5  UR                  [        S5      5         UR                  U5        SSS5        ggg! , (       d  f       g= f)zUExtra format methods for multi methods that adds all the commands
after the options.
N   c              3   <   #    U H  n[        US    5      v   M     g7f)r   Nr  )r]  rB   s     r>   r^  /MultiCommand.format_commands.<locals>.<genexpr>e  s     -NXcc#a&kkXs   Commands)r8   r:   r;   r  r  r   maxr\  r  r   r  )	r   r.   r  r   
subcommandrB   r  rowsr[  s	            r>   r  MultiCommand.format_commandsT  s     ,,S1J""33C{zzOOZ-. 2 x==OOa'#-NX-N*NNED#+
--e4Z./ $, &&q}5&&t, 65   65s   C66
Dr   c                 |  > U(       dT  U R                   (       aC  UR                  (       d2  [        UR                  5       UR                  S9  UR                  5         [        TU ]  X5      nU R                  (       a  X1l	        / Ul
        UR                  $ U(       a  US S USS  sUl	        Ul
        UR                  $ )Nr  r   )r  r   r#   r   r   r   r  rP  rE   r   r   )r   r.   r   restrB  s       r>   rP  MultiCommand.parse_argsp  s    ,,S5J5Jsyy1HHJw!#,::!%CH xx +/8T!"X(CxxrL   c           	        >^ ^ S[         R                  S[         R                  4UU 4S jjnTR                  (       da  T R                  (       a6  T   [        T	T ]  T5      nU" T R                  (       a  / OU5      sS S S 5        $ TR                  [        S5      5        / TR                  QTR                  Qn/ Tl	        / Tl        T R                  (       dy  T   T R                  TU5      u  pVnUc   eUTl        [        T	T ]  T5        UR                  XTTS9nU   U" UR                  R                  U5      5      sS S S 5        sS S S 5        $ T   U(       a  SOS Tl        [        T	T ]  T5        / nU(       aZ  T R                  TU5      u  pVnUc   eUR                  UUTSSS	9nUR                  U5        UR                  / soGl	        U(       a  MZ  / nU H8  nU   UR                  UR                  R                  U5      5        S S S 5        M:     U" U5      sS S S 5        $ ! , (       d  f       GN= f! , (       d  f       O= f S S S 5        GM  ! , (       d  f       GN= f! , (       d  f       M  = f! , (       d  f       g = f)
Nr   r1   c                 r   > TR                   b(  TR                  " TR                   U 40 TR                  D6n U $ rP   )r  r  r   r   r.   r   s    r>   _process_result,MultiCommand.invoke.<locals>._process_result  s3    $$0

4#8#8%N3::NLrL   zMissing command.r   *TF)r   r   r   )r4   r'  r   r  r  r  rE   r   r   r   resolve_commandr   rQ  r7   r  )
r   r.   r#  r   r   rA   rB   r  contextsrB  s
   ``       r>   r  MultiCommand.invoke  s&   	155 	QUU 	 	
 !!** ,B*2D S HHQ)*+ 0##/chh/
 zz &*&:&:3&E#t&)1&s#**8#*F*7??+A+A'+JK W  ,0SdC"GN3
 H&*&:&:3&E#t&**%),1 +  (%,\\2"l $ B#IIgoo44W=> W $ #2&3 S= S, WW J W/ Ss\   *H'AI!H9>	IBI:	I:+I(
I:'
H69
I	I
I%(
I72I::
Jc                    [        US   5      nUnU R                  X5      nUc/  UR                  b"  UR                  U5      nU R                  X5      nUcf  UR                  (       dU  [	        U5      S   (       a  U R                  XR                  5        UR                  [        S5      R                  US95        U(       a  UOS XRSS  4$ )Nr   zNo such command {name!r}.r:  r   )
r%   r:   r   r   r   rP  r   r   r   r  )r   r.   r   rA   original_cmd_namerB   s         r>   r&  MultiCommand.resolve_command  s     DG$$ s- ;333?//9H""31C ;s44"1%XX.HHQ23::@Q:RSxD#ABx77rL   rA   c                     [         e)zkGiven a context and a command name, this returns a
:class:`Command` object if it exists or returns `None`.
rG  r   r.   rA   s      r>   r:   MultiCommand.get_command  s
     "!rL   c                     / $ )zDReturns a list of subcommand names in the order they should
appear.
rp   r;  s     r>   r8   MultiCommand.list_commands  s	     	rL   r0   r*   c           	         > SSK Jn  [        X5       VVs/ sH  u  pEU" XER                  5       S9PM     nnnUR	                  [
        TU ]  X5      5        U$ s  snnf )a   Return a list of completions for the incomplete value. Looks
at the names of options, subcommands, and chained
multi-commands.

:param ctx: Invocation context for this command.
:param incomplete: Value being completed. May be empty.

.. versionadded:: 8.0
r   r)   rZ  )r`  r*   r?   r\  r   r  rb  )r   r.   r0   r*   r=   r7   ra  rB  s          r>   rb  MultiCommand.shell_complete  sa     	: "<C!L
!L 4&@&@&BC!L 	 
 	uw-c>?
s   A)r  rE   r  r  r  )NFNNFNF)"rI   rq   rr   rs   rt   r   r   r4   r%  r&  rj   r+  r'  r   r/   r,  r   r*  r  r   r  r+   r  r  rP  r  ri   r2   r&  r:   r8   rb  r|   r  r  s   @r>   r6   r6     sJ   2 # !%',,0.2>B$jjo$ !%$ D)	$
 JJsO$ $ AJJsAEEz$:;$ $ 
$ $L AFF3:,> $ AFF3K 
-' -m - -+t +

A368J +Z-7 -} - -8g QVVC[ QVVC[ B'' B'aee B'H88"#&&+8	
C!**W"5qvvc{B	C86"w "# "!**W:M " QVVC[ ' s qvvFV?W  rL   c            
         ^  \ rS rSr% SrSr\R                  \R                  \	      \
S'   Sr\R                  \R                  \R                  S    \R                  \   4      \
S'     SS\R                  \   S\R                  \R                  \R                  \\	4   \R                   \	   4      S\R"                  S	S4U 4S
 jjjrSS\	S\R                  \   S	S4S jjr\R(                  S\R*                  S\R"                  4   S	\	4S j5       r\R(                  S\R"                  S\R"                  S	\R*                  \R*                  S\R"                  4   /\	4   4S j5       rS\R"                  S\R"                  S	\R                  \R*                  \R*                  S\R"                  4   /\	4   \	4   4S jr\R(                  S\R*                  S\R"                  4   S	S 4S j5       r\R(                  S\R"                  S\R"                  S	\R*                  \R*                  S\R"                  4   /S 4   4S j5       rS\R"                  S\R"                  S	\R                  \R*                  \R*                  S\R"                  4   /S 4   S 4   4S jrS\S\S	\R                  \	   4S jrS\S	\R4                  \   4S jrSrU =r$ )Groupi  a!  A group allows a command to have subcommands attached. This is
the most common way to implement nesting in Click.

:param name: The name of the group command.
:param commands: A dict mapping names to :class:`Command` objects.
    Can also be a list of :class:`Command`, which will use
    :attr:`Command.name` to create the dict.
:param attrs: Other command arguments described in
    :class:`MultiCommand`, :class:`Command`, and
    :class:`BaseCommand`.

.. versionchanged:: 8.0
    The ``commands`` argument can be a list of command objects.
Ncommand_classgroup_classr=   r   r  r1   c                    > [         TU ]  " U40 UD6  Uc  0 nOI[        U[        R                  5      (       a*  U Vs0 sH  oDR
                  c  M  UR
                  U_M      nnX l        g s  snf rP   )r  r   rF   r   r  r=   r   )r   r=   r   r  crB  s        r>   r   Group.__init__"  sc     	''H#,,//+3J8avv		8HJ 9A Ks   A)A)rB   c                 |    U=(       d    UR                   nUc  [        S5      e[        XUSS9  XR                  U'   g)zsRegisters another :class:`Command` with this group.  If the name
is not provided, the name of the command is used.
NzCommand has no name.T)rC   )r=   r  rK   r   )r   rB   r=   s      r>   add_commandGroup.add_command4  s;     sxx<233Dd;!drL   _Group__func.c                     g rP   rp   r   r>  s     r>   r7   Group.command>  s    BErL   r   r  c                     g rP   rp   r  s      r>   r7   rA  A       9<rL   c                 z  ^ ^^^ SSK Jm  SnT(       a6  [        TS   5      (       a#  [        T5      S:X  a  T(       a   S5       eTu  nSmT R                  (       a!  TR                  S5      c  T R                  TS'   S[        R                  S	[        R                  4   S
[        4UUUU 4S jjnUb  U" U5      $ U$ )a  A shortcut decorator for declaring and attaching a command to
the group. This takes the same arguments as :func:`command` and
immediately registers the created command with this group by
calling :meth:`add_command`.

To customize the command class used, set the
:attr:`command_class` attribute.

.. versionchanged:: 8.1
    This decorator can be applied without parentheses.

.. versionchanged:: 8.0
    Added the :attr:`command_class` attribute.
r   )r7   Nr   z7Use 'command(**kwargs)(callable)' to provide arguments.rp   clsr   .r1   c                 F   > T" T0 TD6" U 5      nTR                  U5        U$ rP   r<  )r   rB   r   r7   r  r   s     r>   r   Group.command.<locals>.decoratore  s*    "D3F3A6CS!JrL   )
r  r7   r   r  r6  r   r4   r+  r'  r2   )r   r   r  funcr  r7   s   ```  @r>   r7   rA  F  s    " 	(37HT!W%%D	QvIHI-GTD&**U"3"; ..F5M	CJ/ 	G 	 	
 T?"rL   c                     g rP   rp   r@  s     r>   groupGroup.groupo  s    @CrL   c                     g rP   rp   r  s      r>   rK  rL  r  rC  rL   c                   ^ ^^^ SSK Jm  SnT(       a6  [        TS   5      (       a#  [        T5      S:X  a  T(       a   S5       eTu  nSmT R                  bC  TR                  S5      c1  T R                  [        L a  [        T 5      TS'   OT R                  TS'   S[        R                  S	[        R                  4   S
S4UUUU 4S jjnUb  U" U5      $ U$ )a  A shortcut decorator for declaring and attaching a group to
the group. This takes the same arguments as :func:`group` and
immediately registers the created group with this group by
calling :meth:`add_command`.

To customize the group class used, set the :attr:`group_class`
attribute.

.. versionchanged:: 8.1
    This decorator can be applied without parentheses.

.. versionchanged:: 8.0
    Added the :attr:`group_class` attribute.
r   )rK  Nr   z5Use 'group(**kwargs)(callable)' to provide arguments.rp   rE  r   .r1   r5  c                 F   > T" T0 TD6" U 5      nTR                  U5        U$ rP   rG  )r   rB   r   rK  r  r   s     r>   r  Group.group.<locals>.decorator  s*    //2CS!JrL   )
r  rK  r   r  r7  r   rH   r4   r+  r'  )r   r   r  rI  r  rK  s   ```  @r>   rK  rL  w  s    " 	&37HT!W%%D	QvGFG-GTD'FJJu,=,E4' $T
u $ 0 0u	CJ/ 	G 	 	
 T?"rL   r.   rA   c                 8    U R                   R                  U5      $ rP   )r   r   r-  s      r>   r:   Group.get_command  s    }}  **rL   c                 ,    [        U R                  5      $ rP   )rk   r   r;  s     r>   r8   Group.list_commands  s    dmm$$rL   )r   NNrP   )rI   rq   rr   rs   rt   r6  r4   r%  r#  r2   r$  r7  r2  rH   r&  r(  r  r'  r   r<  r1  r+  r7   rK  r/   r:   r*  r8   r|   r  r  s   @r>   r5  r5    s   ( 26M1::affWo.5 GKKAGGAFF7OQVVD\$ABCJ
 !% AjjoA **GGA$$S'\2AJJw4GGH
A A 
A A$"w "ajjo " " ZZEajjaee4EE EZZ<UU<&'ee<	
QZZQUU
+,g5	6< <'UU'&'ee'	
QZZQUU
34g=>G	H'R ZZCAJJsAEEz2CwC CZZ<UU<&'ee<	
QZZQUU
+,g5	6< <*UU*&'ee*	
QZZQUU
34g=>G	H*X+w +# +!**W:M +% %QVVC[ % %rL   r5  c            	         ^  \ rS rSrSr  SS\R                  \   S\R                  \R                  \	      S\R                  SS4U 4S jjjrS	\	SS4S
 jrS\S\S\R                  \   4S jrS\S\R                  \   4S jrSrU =r$ )CommandCollectioni  aS  A command collection is a multi command that merges multiple multi
commands together into one.  This is a straightforward implementation
that accepts a list of different multi commands as sources and
provides all the commands for each of them.

See :class:`MultiCommand` and :class:`Command` for the description of
``name`` and ``attrs``.
Nr=   sourcesr  r1   c                 H   > [         TU ]  " U40 UD6  U=(       d    / U l        g rP   )r  r   rX  )r   r=   rX  r  rB  s       r>   r   CommandCollection.__init__  s"     	''-4]rL   	multi_cmdc                 :    U R                   R                  U5        g)z1Adds a new multi command to the chain dispatcher.N)rX  r  )r   r[  s     r>   
add_sourceCommandCollection.add_source  s    I&rL   r.   rA   c                     U R                    H8  nUR                  X5      nUc  M  U R                  (       a  [        XU5        Us  $    g rP   )rX  r:   rE   rK   )r   r.   rA   r  r   s        r>   r:   CommandCollection.get_command  s@    llF##C2B~::';	 # rL   c                     [        5       nU R                   H#  nUR                  UR                  U5      5        M%     [	        U5      $ rP   )r   rX  r  r8   rk   )r   r.   r   r  s       r>   r8   CommandCollection.list_commands  s:    llFIIf**3/0 # bzrL   )rX  rU  )rI   rq   rr   rs   rt   r4   r%  r&  r*  r6   r'  r   r]  r/   r2   r:   r8   r|   r  r  s   @r>   rW  rW    s     !%48;jjo; AFF<01; 	;
 
; ;'L 'T '
w 
# 
!**W:M 
 QVVC[  rL   rW  r   c                 N    [        U [        5      (       a  [        e[        U 5      $ )zlCheck if the value is iterable but not a string. Raises a type
error, or return an iterator over the value.
)rF   r&  r  rS   )r   s    r>   _check_iterrd    s      %;rL   c                      \ rS rSrSrSr            S2S\R                  \R                  \	      S\R                  \R                  \R                  \R                  4      S\S\R                  \R                  \R                  \R                  / \R                  4   4      S	\R                  \R                  \S \R                  /\R                  4      S
\R                  \   S\S\R                  \	   S\S\S\R                  \R                  \	\R                  \	   4      S\R                  \R                  \S \	/\R                  \R$                  S   \R$                  \	   4   4      SS4S jjrS\R(                  \	\R                  4   4S jrS\	4S jrS\R                  \	   S\S\R.                  \R                  \	   \R$                  \	   \R$                  \	   4   4S jr\S\	4S j5       rS\	4S jr\R8                   S3S\SSS\R                  \R                     4S jj5       r\R8                   S4S\S\S\R                  \R                  \R                  \R                  / \R                  4   4      4S jj5       r S3S\S\S\R                  \R                  \R                  \R                  / \R                  4   4      4S jjrS \S\SS4S! jrS\S"\R@                  \	\R                  4   S\R.                  \R                  \!4   4S# jr"S\S$\R                  S\R                  4S% jr#S$\R                  S\4S& jr$S\S$\R                  S\R                  4S' jr%S\S\R                  \	   4S( jr&S\S\R                  \R                     4S) jr'S\S"\R@                  \	\R                  4   S*\R$                  \	   S\R.                  \R                  \R$                  \	   4   4S+ jr(S\S\R                  \R.                  \	\	4      4S, jr)S\S\R$                  \	   4S- jr*S\S\	4S. jr+S\S/\	S\R$                  S   4S0 jr,S1r-g)5rV   i  a  A parameter to a command comes in two versions: they are either
:class:`Option`\s or :class:`Argument`\s.  Other subclasses are currently
not supported by design as some of the internals for parsing are
intentionally not finalized.

Some settings are supported by both options and arguments.

:param param_decls: the parameter declarations for this option or
                    argument.  This is a list of flags or argument
                    names.
:param type: the type that should be used.  Either a :class:`ParamType`
             or a Python type.  The latter is converted into the former
             automatically if supported.
:param required: controls if this is optional or not.
:param default: the default value if omitted.  This can also be a callable,
                in which case it's invoked when the default is needed
                without any arguments.
:param callback: A function to further process or validate the value
    after type conversion. It is called as ``f(ctx, param, value)``
    and must return the value. It is called for all sources,
    including prompts.
:param nargs: the number of arguments to match.  If not ``1`` the return
              value is a tuple instead of single value.  The default for
              nargs is ``1`` (except if the type is a tuple, then it's
              the arity of the tuple). If ``nargs=-1``, all remaining
              parameters are collected.
:param metavar: how the value is represented in the help page.
:param expose_value: if this is `True` then the value is passed onwards
                     to the command callback and stored on the context,
                     otherwise it's skipped.
:param is_eager: eager values are processed before non eager ones.  This
                 should not be set for arguments or it will inverse the
                 order of processing.
:param envvar: a string or list of strings that are environment variables
               that should be checked.
:param shell_complete: A function that returns custom shell
    completions. Used instead of the param's type completion if
    given. Takes ``ctx, param, incomplete`` and must return a list
    of :class:`~click.shell_completion.CompletionItem` or a list of
    strings.

.. versionchanged:: 8.0
    ``process_value`` validates required parameters and bounded
    ``nargs``, and invokes the parameter callback before returning
    the value. This allows the callback to validate prompts.
    ``full_process_value`` is removed.

.. versionchanged:: 8.0
    ``autocompletion`` is renamed to ``shell_complete`` and has new
    semantics described above. The old name is deprecated and will
    be removed in 8.1, until then it will be wrapped to match the
    new requirements.

.. versionchanged:: 8.0
    For ``multiple=True, nargs>1``, the default must be a list of
    tuples.

.. versionchanged:: 8.0
    Setting a default is no longer required for ``nargs>1``, it will
    default to ``None``. ``multiple=True`` or ``nargs=-1`` will
    default to ``()``.

.. versionchanged:: 7.1
    Empty environment variables are ignored rather than taking the
    empty string value. This makes it possible for scripts to clear
    variables if they can't unset them.

.. versionchanged:: 2.0
    Changed signature for parameter callback to also be passed the
    parameter. The old callback format will still work, but it will
    raise a warning to give you a chance to migrate the code easier.
	parameterNparam_declsrH   r  defaultr   nargsr  metavarr  rc   envvarrb  r*   r1   c           	         U   U   U   U R                  U=(       d    SU	5      u  U l        U l        U l        [        R
                  " X$5      U l        Uc4  U R                  R                  (       a  U R                  R                  nOSnX0l	        XPl
        X`l        Xpl        Xl        X@l        Xl        Xl        Xl        Xl         U R                  R                  (       aM  X`R                  R                  :w  a4  ['        SU R                  R                   SU R                  < SU S35      e[)        U5      (       d  UOS nUbh  U(       a   [+        [-        U5      S 5      nUS:w  aD  Ub@   [-        U5        US:  a-  [1        U5      U:w  a  U(       a  S
OSn['        SU SU S35      eg g g g g ! [.         a    ['        S5      S ef = f! [.         a    U(       a  SnOS	n['        U5      S ef = f)Nrp   r   z'nargs' must be z (or None) for type z, but it was r  z1'default' must be a list when 'multiple' is true.zK'default' must be a list of lists when 'multiple' is true and 'nargs' != 1.z+'default' must be a list when 'nargs' != 1.zitem lengthlengthz
'default' z must match nargs=)_parse_declsr=   r  r  r   convert_typerH   is_compositearityr  r   ri  r  r  rh  rc   rj  rk  _custom_shell_completera   r   nextrd  r  r  )r   rg  rH   r  rh  r   ri  r  rj  r  rc   rk  rb  check_defaultr   subjects                   r>   r   Parameter.__init__-  s   ( 	484E4E2|5
1	49d1 &+%7%7%F	 =yy%%		  
 ( &4#yy%%%99??*B &tyy&7 8!YYMugQ@  ,4G+<+<G$M($(,[-G(N A:-";<#M2 qyS%75%@3;-((	1CE7!L  &Ay #<: )
 % $(O#$$ % 	<#!: $
 'TG(1t;	<s   F, *G ,G#G)c                     U R                   U R                  U R                  U R                  U R                  R                  5       U R                  U R                  U R                  U R                  U R                  S.
$ )zGather information that could be useful for a tool generating
user-facing documentation.

Use :meth:`click.Context.to_info_dict` to traverse the entire
CLI structure.

.. versionadded:: 8.0
)
r=   param_type_namer  r  rH   r  ri  r  rh  rk  )r=   rx  r  r  rH   r   r  ri  r  rh  rk  r   s    r>   r   Parameter.to_info_dict  sa     II#33II"11II**,ZZ||kk
 	
rL   c                 P    SU R                   R                   SU R                   S3$ r>  rA  r   s    r>   rC  Parameter.__repr__  rE  rL   declsc                     [        5       erP   rG  )r   r|  r  s      r>   rn  Parameter._parse_decls  s     "##rL   c                     U R                   $ )z}Returns the human readable name of this parameter.  This is the
same as the name for options, but the metavar for arguments.
r:  r   s    r>   human_readable_nameParameter.human_readable_name  s    
 yyrL   c                     U R                   b  U R                   $ U R                  R                  U 5      nUc$  U R                  R                  R	                  5       nU R
                  S:w  a  US-  nU$ )Nr   ...)rj  rH   get_metavarr=   r   ri  )r   rj  s     r>   make_metavarParameter.make_metavar  s_    <<#<<))''-?iinn**,G::?uGrL   r.   r   r   c                     g rP   rp   r   r.   r   s      r>   r  Parameter.get_default  r   rL   c                     g rP   rp   r  s      r>   r  r    r   rL   c                     UR                  U R                  SS9nUc  U R                  nU(       a  [        U5      (       a  U" 5       nU$ )aE  Get the default for the parameter. Tries
:meth:`Context.lookup_default` first, then the local default.

:param ctx: Current context.
:param call: If the default is a callable, call it. Disable to
    return the callable instead.

.. versionchanged:: 8.0.2
    Type casting is no longer performed when getting a default.

.. versionchanged:: 8.0.1
    Type casting can fail in resilient parsing mode. Invalid
    defaults will not prevent showing help text.

.. versionchanged:: 8.0
    Looks at ``ctx.default_map`` first.

.. versionchanged:: 8.0
    Added the ``call`` parameter.
Fr   )r   r=   rh  r   )r   r.   r   r   s       r>   r  r    sB    . ""4995"9=LLEHUOOGErL   r  c                     [        5       erP   rG  r   r  r.   s      r>   r  Parameter.add_to_parser  s    !##rL   r  c                 J   UR                  U R                  5      n[        R                  nUc!  U R	                  U5      n[        R
                  nUc+  UR                  U R                  5      n[        R                  nUc!  U R                  U5      n[        R                  nX44$ rP   )
r   r=   rn   rw   value_from_envvarrx   r   rz   r  ry   )r   r.   r  r   r  s        r>   consume_valueParameter.consume_value  s     # ,,=**3/E$00F=&&tyy1E$00F=$$S)E$,,F}rL   r   c                   ^ ^^^ Uc%  T R                   (       d  T R                  S:X  a  S$ S$ S[        R                  S[        R                  [        R                     4UU 4S jjmT R                  S:X  d  T R
                  R                  (       a*  S[        R                  S[        R                  4UU 4S jjmOeT R                  S:X  a+  S[        R                  S[        R                  4UUU 4S	 jjmO*S[        R                  S[        R                  4UUU 4S
 jjmT R                   (       a  [        U4S jT" U5       5       5      $ T" U5      $ )zeConvert and validate a value against the option's
:attr:`type`, :attr:`multiple`, and :attr:`nargs`.
Nrp   r   r1   c                 b   >  [        U 5      $ ! [         a    [        [        S5      TTS9S ef = f)NzValue must be an iterable.r.   rU   )rd  r  r   r   r"  s    r>   
check_iter-Parameter.type_cast_value.<locals>.check_iter	  sA    "5))  #23D	s   
  .r   c                 &   > TR                  U TTS9$ )N)rU   r.   rH   r"  s    r>   convert*Parameter.type_cast_value.<locals>.convert	  s    yydy<<rL   c                 <   > [        UU4S jT" U 5       5       5      $ )Nc              3   H   >#    U H  nTR                  UTT5      v   M     g 7frP   r  r]  xr.   r   s     r>   r^  =Parameter.type_cast_value.<locals>.convert.<locals>.<genexpr>	  s#     P>OTYYq$44>O   ")tupler   r  r.   r   s    r>   r  r  	  s    Pj>OPPPrL   c           	        > [        T" U 5      5      n [        U 5      TR                  :w  a@  [        [	        SS[        U 5      5      R                  TR                  [        U 5      S9TTS9e[        UU4S jU  5       5      $ )Nz%Takes {nargs} values but 1 was given.z*Takes {nargs} values but {len} were given.)ri  r  r  c              3   H   >#    U H  nTR                  UTT5      v   M     g 7frP   r  r  s     r>   r^  r  &	  s!     DeTYYq$44er  )r  r  ri  r   r   r  r  s    r>   r  r  	  su    j/0u:+& CHJ !&tzzs5z&B"  DeDDDrL   c              3   2   >#    U H  nT" U5      v   M     g 7frP   rp   )r]  r  r  s     r>   r^  ,Parameter.type_cast_value.<locals>.<genexpr>)	  s     ?->->s   )r  ri  r4   r'  r.  rH   rp  r  )r   r.   r   r  r  s   `` @@r>   r  Parameter.type_cast_value  s    =$***:2DD		aee 		

155(9 		 		 ::?dii44=quu = = = ZZ2Qquu Q Q Q
Equu E E E  ==?Z->???u~rL   c                 \    Uc  gU R                   S:w  d  U R                  (       a  US:X  a  gg)NTr   rp   F)ri  r  )r   r   s     r>   value_is_missingParameter.value_is_missing-	  s'    =JJ!Ot}}%2+rL   c                     U R                  X5      nU R                  (       a  U R                  U5      (       a	  [        XS9eU R                  b  U R	                  XU5      nU$ )Nr  )r  r  r  r   r   )r   r.   r   s      r>   process_valueParameter.process_value6	  sS    $$S0==T22599"s77==$MM#U3ErL   c                 @   U R                   c  g [        U R                   [        5      (       a4  [        R                  R                  U R                   5      nU(       a  U$  g U R                    H-  n[        R                  R                  U5      nU(       d  M+  Us  $    g rP   )rk  rF   r&  rr  r  r   )r   r.   r   rk  s       r>   resolve_envvar_valueParameter.resolve_envvar_valueA	  sy    ;;dkk3'',B	   ++ZZ^^F+2I	 & rL   c                     U R                  U5      nUb+  U R                  S:w  a  U R                  R                  U5      nU$ r   )r  ri  rH   split_envvar_value)r   r.   r   s      r>   r  Parameter.value_from_envvarS	  s:     $ 9 9# >>djjAo--b1B	rL   r   c                 n   [        XS9   U R                  X5      u  pEUR                  U R                  U5         U R	                  X5      nS S S 5        U R                  (       a  WUR                  U R                  '   WU4$ ! [
         a    UR                  (       d  e S n NVf = f! , (       d  f       N`= f)N)rU   )	rY   r  r  r=   r  	Exceptionr   r  r   )r   r.   r  r   r   r  s         r>   r  Parameter.handle_parse_result[	  s     "#2 ..s9ME$$TYY7**36 3 $)CJJtyy!d{  ,,	 32s(   0B&BB# B&"B##B&&
B4c                     g rP   rp   r;  s     r>   r  Parameter.get_help_recordo	  s    rL   c                     / $ rP   rp   r;  s     r>   r   Parameter.get_usage_piecesr	  s    	rL   c                 r    U R                   =(       d    U R                  /nSR                  S U 5       5      $ )zkGet a stringified version of the param for use in error messages to
indicate which param caused the error.
 / c              3   ,   #    U H  nS U S 3v   M     g7f)'Nrp   )r]  r  s     r>   r^  +Parameter.get_error_hint.<locals>.<genexpr>z	  s     6IqAaS(Is   )r  r  r   )r   r.   	hint_lists      r>   get_error_hintParameter.get_error_hintu	  s0     II;$":":!;	zz6I666rL   r0   c                 H   U R                   bu  U R                  XU5      nU(       a4  [        US   [        5      (       a  SSKJn  U Vs/ sH
  oT" U5      PM     nn[
        R                  " [
        R                  S   U5      $ U R                  R                  XU5      $ s  snf )aX  Return a list of completions for the incomplete value. If a
``shell_complete`` function was given during init, it is used.
Otherwise, the :attr:`type`
:meth:`~click.types.ParamType.shell_complete` function is used.

:param ctx: Invocation context for this command.
:param incomplete: Value being completed. May be empty.

.. versionadded:: 8.0
r   r)   r*   )
rr  rF   r&  r`  r*   r4   r5   r*  rH   rb  )r   r.   r0   ra  r*   r9  s         r>   rb  Parameter.shell_complete|	  s     &&211#ZHG:gaj#66A6=>g>!,g>66!&&!12G<<yy'':>>	 ?s   	B)rr  r   rh  rk  r  rc   rj  r  r=   ri  r  r  r  rH   )NNFNNNFNTFNNr!  r"  ).rI   rq   rr   rs   rt   rx  r4   r%  r  r&  r2  r   	ParamTyper'  rj   r+  r/   r)  r*  r   r,  r   rC  ri   rn  r/  r  r  r1  r  r   r  Mappingrn   r  r  r  r  r  r  r  r  r   r  rb  r|   rp   rL   r>   rV   rV     s   GR "O 48<@EIQU!%#'!<@ %VZZ

30V jj!%%!789V 	V
 AGGAEE1::b!%%i+@$@ABV **QZZ+quu(Equu(LMNV zz#V V CV V V 

1773

3#789V 

JJ+s+/0!&&+=>@
V& 
'Vp
affS!%%Z0 
,:# :$ZZ_$48$	
C!&&+qvvc{:	;$
 S  c  ZZ7;  "4 	
AEE	    ZZ),@@"&@	
AGGAEE1::b!%%i#889	:@ @
 *."&	
AGGAEE1::b!%%i#889	:B$L $w $4 $"#))CJ"7	
'	((17 1155 1QUU 1faee  	 	 	155 	 AJJsO $W AEE1B "#))CJ"7?@vvc{	
s#	$(7 qzz!''#s(:K/L G s 7' 7c 7?' ?s ?qvvFV?W ?rL   c            %         ^  \ rS rSrSrSr                S,S\R                  \R                  \	      S\R                  \\	S4   S\R                  \\	4   S\R                  \\	4   S	\S
\S\R                  \   S\R                  \R                     S\S\S\S\R                  \R                  \R                  \R                  4      S\R                  \	   S\S\S\S\R                  SS4$U 4S jjjrS\R                   \	\R                  4   4U 4S jjrS\R                  \	   S\S\R$                  \R                  \	   \R&                  \	   \R&                  \	   4   4S jrS\S\SS4S jrS\S\R                  \R$                  \	\	4      4S jr\R2                   S-S\S S!S\R                  \R                     4S" jj5       r\R2                   S.S\S \S\R                  \R                  \R                  \R6                  / \R                  4   4      4S# jj5       r S-S\S \S\R                  \R                  \R                  \R6                  / \R                  4   4      4U 4S$ jjjrS\S\R                  4S% jrS\S\R                  \	   4U 4S& jjrS\S\R                  \R                     4S' jrS\S(\R>                  \	S)4   S\R$                  \R                  \ 4   4U 4S* jjr!S+r"U =r#$ )/r  i	  a  Options are usually optional values on the command line and
have some extra features that arguments don't have.

All other parameters are passed onwards to the parameter constructor.

:param show_default: Show the default value for this option in its
    help text. Values are not shown by default, unless
    :attr:`Context.show_default` is ``True``. If this value is a
    string, it shows that string in parentheses instead of the
    actual value. This is particularly useful for dynamic options.
    For single option boolean flags, the default remains hidden if
    its value is ``False``.
:param show_envvar: Controls if an environment variable should be
    shown on the help page. Normally, environment variables are not
    shown.
:param prompt: If set to ``True`` or a non empty string then the
    user will be prompted for input. If set to ``True`` the prompt
    will be the option name capitalized.
:param confirmation_prompt: Prompt a second time to confirm the
    value if it was prompted for. Can be set to a string instead of
    ``True`` to customize the message.
:param prompt_required: If set to ``False``, the user will be
    prompted for input only when the option was specified as a flag
    without a value.
:param hide_input: If this is ``True`` then the input on the prompt
    will be hidden from the user. This is useful for password input.
:param is_flag: forces this option to act as a flag.  The default is
                auto detection.
:param flag_value: which value should be used for this flag if it's
                   enabled.  This is set to a boolean automatically if
                   the option string contains a slash to mark two options.
:param multiple: if this is set to `True` then the argument is accepted
                 multiple times and recorded.  This is similar to ``nargs``
                 in how it works but supports arbitrary number of
                 arguments.
:param count: this flag makes an option increment an integer.
:param allow_from_autoenv: if this is enabled then the value of this
                           parameter will be pulled from an environment
                           variable in case a prefix is defined on the
                           context.
:param help: the help string.
:param hidden: hide this option from help outputs.
:param attrs: Other command arguments described in :class:`Parameter`.

.. versionchanged:: 8.1.0
    Help text indentation is cleaned here instead of only in the
    ``@option`` decorator.

.. versionchanged:: 8.1.0
    The ``show_default`` parameter overrides
    ``Context.show_default``.

.. versionchanged:: 8.1.0
    The default of a single option boolean flag is not shown if the
    default value is ``False``.

.. versionchanged:: 8.0.1
    ``type`` is detected from ``flag_value`` if given.
optionNrg  r   r   confirmation_promptprompt_required
hide_inputis_flag
flag_valuer  countallow_from_autoenvrH   r[  r;   show_choicesshow_envvarr  r1   c                 p  > U(       a  [         R                  " U5      nSU;  n[        TU ]  " U4XS.UD6  USL aC  U R                  c  [        S5      eU R                  R                  SS5      R                  5       nO
USL a  S nOUnUU l        X@l	        XPl
        X`l        Xl        U R                  S L=(       a    U R                  (       + U l        Uc0  Ub  SnOIU R                  (       a  SnO5[        U R                  5      nOUSL a  U R                  (       d	  US LU l        U   U(       a.  U(       a'  U R                   (       d  U	(       a  SU l        OSU l        Uc  U R"                  (       + nU   U(       a  Uc  [$        R&                  " S U5      U l        Xpl        U=(       a$    [-        U R(                  [$        R.                  5      U l        Xl        Xl        U
(       a*  Uc  [$        R6                  " S	S
9U l        U(       a  S	U l        Xl        Xl        X l        Xl        UU l          U RB                  S:X  a  [        S5      eU R                  (       a-  U R*                  (       a  U R0                  (       d  [        S5      eU R0                  (       d  U R                  (       a  [        S5      eU R0                  (       a)  U R                  (       a  U R                  b  [        S5      eU R4                  (       a9  U RD                  (       a  [        S5      eU R*                  (       a  [        S5      eg g )Nrh  )rH   r  Tz&'name' is required with 'prompt=True'.r   r   Frp   r   )minr  z&nargs=-1 is not supported for options.z+'prompt' is not valid for non-boolean flag.z1Secondary flag is not valid for non-boolean flag.z9'prompt' with 'hide_input' is not valid for boolean flag.z%'count' is not valid with 'multiple'.z$'count' is not valid with 'is_flag'.)#r  r  r  r   r=   r  r   
capitalizer   r  r  r  r;   r   rj   r  r  rh  r   ro  rH   r  rF   BoolParamTypeis_bool_flagr  r  IntRanger  r[  r   r  r  ri  r  )r   rg  r   r   r  r  r  r  r  r  r  r  rH   r[  r;   r  r  r  default_is_missingprompt_textrB  s                       r>   r   Option.__init__	  s   ( ##D)D&e3L4LeLT>yy  HII+/99+<+<S#+F+Q+Q+SKu_K K!#6 .$ "&D!8!UAUAU=U?%'' t223d&<&< &0t%;D")$--!$!\\)Jt| **4<DI$")"XjEDWDW.X!+ 
|!NNq1	! "4	((&zzR HII{{t||D4E4E MNN$$)<)< STT  T__9PO  zz==#$KLL<<#$JKK  	 rL   c           	         > [         TU ]  5       nUR                  U R                  U R                  U R
                  U R                  U R                  U R                  S9  U$ )N)r[  r   r  r  r  r;   )	r  r   r  r[  r   r  r  r  r;   )r   r  rB  s     r>   r   Option.to_info_dictI
  sU    G(*	;;LL**;; 	 	
 rL   r|  r  c                 n   / n/ nS n/ nU GH  nUR                  5       (       a  Ub  [        SU S35      eUnM/  US S S:X  a  SOSnX;   a  UR                  US5      u  pU	R                  5       n	U	(       a+  UR	                  [        U	5      5        UR	                  U	5        U
R                  5       n
U
(       a  UR	                  U
R                  5       5        X:X  a  [        SU< S35      eM  UR	                  [        U5      5        UR	                  U5        GM     UcT  U(       aM  UR                  S S	9  US
   S   R                  SS5      R                  5       nUR                  5       (       d  S nUc  U(       d  S X44$ [        SU< 35      eU(       d  U(       d  [        SU SU S35      eXSU4$ )NzName 'z' defined twicer   /;zBoolean option z) cannot use the same flag for true/false.c                      [        U S   5      * $ )Nr   r  )r  s    r>   <lambda>%Option._parse_decls.<locals>.<lambda>w
  s    s1Q4yjrL   rg   r   r   r   z6Could not determine name for option with declarations z*No options defined but a name was passed (zH). Did you mean to declare an argument instead? Did you mean to pass '--z'?)isidentifierr  splitr  r  r   r   ra   sortr   lower)r   r|  r  r  r  r=   possible_namesdecl
split_charfirstseconds              r>   rn  Option._parse_declsU
  s    D  ""##fTF/$BCC$(!HOS
%$(JJz1$=ME!LLNE&--i.>?E*#]]_F&--fmmo>(-dX 69 9  ' #)))D/:KK%/ 2 <N$89!!$Q'//S9??AD$$&&<T11H	R  N<TF C((,vR1  >))rL   r  r.   c                 *   U R                   (       a  SnOU R                  (       a  SnOSnU R                  (       a  U S3nU R                  (       a_  U R                  (       aN  UR                  X R                  U R                  USS9  UR                  U U R                  U R                  USS9  g UR                  U U R                  U R                  UU R                  S9  g UR                  U U R                  U R                  UU R                  S9  g )	Nr  r  store_constT)r   r  destactionconstF)r   r  r  r  ri  )
r  r  r  r  r  
add_optionr  r=   r  ri  )r   r  r.   r  s       r>   r  Option.add_to_parser
  s    ==FZZFF<<xv&F  T%8%8!!99499VSW "  !!,,! "  !!!// "  YYYYjj  rL   c                   ^ ^ T R                   (       a  g SmS[        R                  [           S[        4UU 4S jjnU" T R                  5      /nT R
                  (       a!  UR                  U" T R
                  5      5        T R                  =(       d    Sn/ nT R                  (       a  T R                  nUcT  T R                  (       aC  UR                  b6  T R                  b)  UR                   ST R                  R                  5        3nUbV  [        U[        5      (       a  UOSR                  S U 5       5      nUR                  [!        S	5      R#                  US
95        UR$                  nSUl         T R'                  USS9n	Xl        Sn
SnT R(                  b0  [        T R(                  [        5      (       a  S=pO&T R(                  n
OUR(                  b  UR(                  n
U(       d  U
(       Ga6  U	Gb2  U(       a  ST R(                   S3nO[        U	[*        [,        45      (       a  SR                  S U	 5       5      nO[.        R0                  " U	5      (       a  [!        S5      nOT R2                  (       a@  T R
                  (       a/  [5        U	(       a  T R                  OT R
                  S   5      S   nO@T R2                  (       a  T R
                  (       d
  U	(       d  SnOU	S:X  a  SnO[        U	5      nU(       a'  UR                  [!        S5      R#                  US95        [        T R6                  [8        R:                  5      (       at  T R<                  (       a1  T R6                  R>                  S:X  a  T R6                  R@                  b2  T R6                  RC                  5       nU(       a  UR                  U5        T RD                  (       a  UR                  [!        S5      5        U(       a&  SR                  U5      nU(       a  U SU S3OSU S3nT(       a  SOSR                  U5      U4$ ! Xl        f = f)NFr  r1   c                    > [        U 5      u  pU(       a  SmTR                  (       d'  TR                  (       d  USTR                  5        3-  nU$ )NTr   )r   r  r  r  )r  r   any_slashesany_prefix_is_slashr   s      r>   _write_opts+Option.get_help_record.<locals>._write_opts
  sG     +40OB&*#<<

$++-.//IrL   r   r   z, c              3   6   #    U H  n[        U5      v   M     g 7frP   r&  r]  ds     r>   r^  )Option.get_help_record.<locals>.<genexpr>
  s     ":6a3q666   zenv var: {var})varTr  ()c              3   6   #    U H  n[        U5      v   M     g 7frP   r  r   s     r>   r^  r  
  s     *I=a3q66=r  z	(dynamic)r   r   z""zdefault: {default})rh  r  z; z  [][r  )#r;   r4   r  r&  r  r  r  r[  r  rk  r  r   r=   r   rF   r   r   r  r   r  r   rQ   r  r  
isfunctionr  r   rH   r   _NumberRangeBaser  r  r  _describe_ranger  )r   r.   r  r   r[  rL  rk  var_str	resilientdefault_valuer   show_default_is_strdefault_string	range_str	extra_strr  s   `              @r>   r  Option.get_help_record
  si   ;;#	ajjo 	# 	 	 $))$%IIk$"5"567yyB[[F~++..:		- # 6 67q9J8KLF! "&#.. ":6":: 
 Q/077G7DE
 ))	 $	. ,,Su,=M$-!#($++S11599#l#00)++L<]5N"#$T%6%6$7q!9MD%=99!%*I=*I!I##M22!";""t':': "+"/TYYT5H5H!L"" ""4+>+>}!#"$!%!$]!3Q34;;N;ST tyy%"8"899ZZDIIMMQ$6499==;P		113IY'==LL:'		%(I/3dV3yk+1YKq9ID+<<R@$FFk %.!s   :Q   Qr   r   c                     g rP   rp   r  s      r>   r  Option.get_default!  r   rL   c                     g rP   rp   r  s      r>   r  r  &  r   rL   c                 F  > U R                   (       a  U R                  (       dr  UR                  R                   HW  nUR                  U R                  :X  d  M  UR
                  (       d  M2  [        R                  " [        U5      R                  s  $    g [        TU ]-  XS9$ )Nr  )r  r  r7   r   r=   rh  r4   r5   r  r  r  r  )r   r.   r   rU   rB  s       r>   r  r  +  so     << 1 1++::*u}}}66&%0;;; , w"3"22rL   c           
         ^ ^ T R                   c   eT R                  T5      nT R                  (       a  [        T R                   U5      $ [        T R                   UT R                  T R
                  T R                  T R                  UU 4S jS9$ )zThis is an alternative flow that can be activated in the full
value processing if a value does not exist.  It will prompt the
user until a valid value exists and then returns the processed
value as result.
c                 (   > TR                  TU 5      $ rP   )r  )r  r.   r   s    r>   r  )Option.prompt_for_value.<locals>.<lambda>R  s    !3!3C!;rL   )rh  rH   r  r  r  
value_proc)r   r  r  r   rH   r  r  r  )r   r.   rh  s   `` r>   prompt_for_valueOption.prompt_for_value;  s}     {{&&& ""3' 4;;00KK** $ 8 8;
 	
rL   c                 &  > [         TU ]  U5      nUb  U$ U R                  (       ak  UR                  b^  U R                  bQ  UR                   SU R                  R                  5        3n[        R                  R                  U5      nU(       a  U$ g )Nr   )	r  r  r  r   r=   r   rr  r  r   )r   r.   r   rk  rB  s       r>   r  Option.resolve_envvar_valueU  s}    W)#.>I ##&&2		%../q1B0CDF'B	rL   c                 (   U R                  U5      nUc  g U R                  S:g  [        U R                  5      -   nUS:  aQ  U R                  R                  U5      nU R                  (       a%  U R                  S:w  a  [        X R                  5      nU$ r   )r  ri  rj   r  rH   r  rT   )r   r.   r   value_depths       r>   r  Option.value_from_envvarh  st     $ 9 9# >:zzQ$t}}*==?--b1B}}q2zz*	rL   r  rV   c                   > [         TU ]  X5      u  p4U[        L ab  U R                  b5  UR                  (       d$  U R                  U5      n[        R                  nX44$ U R                  n[        R                  n X44$ U R                  (       aR  UbO  [        S U 5       5      (       a8  U Vs/ sH  oU[        L a  U R                  OUPM     nn[        R                  nX44$ US [        R                  1;   aa  U R                  bT  U R                  (       d  U R                  (       a2  UR                  (       d!  U R                  U5      n[        R                  nX44$ s  snf )Nc              3   .   #    U H  o[         L v   M     g 7frP   r   )r]  vs     r>   r^  'Option.consume_value.<locals>.<genexpr>  s     :Eq**Es   )r  r  r   r   r   r  rn   r{   r  rw   r  anyry   r  r  )r   r.   r  r   r  r&  rB  s         r>   r  Option.consume_valuex  s0    -c8
 %%{{&s/D/D--c2(//0 }- (44* }% MM!:E:::OTUu!->(>T__AEuEU$00F } t_4455'$"6"6))))#.E$++F} Vs   -E)r   r  r  r  rh  r  r[  r;   r  r  r  r   r  r  r   r  rH   )NNFFTFNNFFTNNFTFr!  r"  )$rI   rq   rr   rs   rt   rx  r4   r%  r  r&  r2  rj   r'  r   r  r   r,  r   ri   r*  rn  r   r/   r  r  r1  r  r+  r  r  r  r  rn   r  r|   r  r  s   @r>   r  r  	  s   :x O 4815%*27 $ $((,#'<@ $!!#tLZZ

30tL ggdCo.tL c	"	tL
 WWT3Y/tL tL tL D!tL JJquu%tL tL tL !tL jj!%%!789tL jjotL tL  !tL" #tL$ %tL& 
'tL tLl
affS!%%Z0 
5*ZZ_5*485*	
C!&&+qvvc{:	;5*n%L %w %4 %NlG7 lGqzz!''#s(:K/L lG\ ZZ7;  "4 	
AEE	    ZZ),@@"&@	
AGGAEE1::b!%%i#889	:@ @
 *.33"&3	
AGGAEE1::b!%%i#889	:3 3 
G 
 
4 AJJsO &W AEE1B  ##"#))C,<"=#	
'	(# #rL   r  c            
         ^  \ rS rSrSrSr SS\R                  \   S\R                  \
   S\R                  SS4U 4S	 jjjr\S\4S
 j5       rS\4S jrS\R                  \   S\
S\R                   \R                  \   \R"                  \   \R"                  \   4   4S jrS\S\R"                  \   4S jrS\S\4S jrS\S\SS4S jrSrU =r$ )r  i  zArguments are positional parameters to a command.  They generally
provide fewer features than options but can have infinite ``nargs``
and are required by default.

All parameters are passed onwards to the constructor of :class:`Parameter`.
argumentNrg  r  r  r1   c                    > Uc*  UR                  S5      b  SnOUR                  SS5      S:  nSU;   a  [        S5      e[        TU ]  " U4SU0UD6   U R                  b  U R
                  S	:X  a  [        S
5      eg g )Nrh  Fri  r   r   r  z9__init__() got an unexpected keyword argument 'multiple'.r  r  z('default' is not supported for nargs=-1.)r   r  r  r   rh  ri  )r   rg  r  r  rB  s       r>   r   Argument.__init__  s     yy#/  99Wa014WXXAxA5A||'DJJ",< JKK -='rL   c                 h    U R                   b  U R                   $ U R                  R                  5       $ rP   )rj  r=   r   r   s    r>   r  Argument.human_readable_name  s'    <<#<<yy  rL   c                    U R                   b  U R                   $ U R                  R                  U 5      nU(       d  U R                  R	                  5       nU R
                  (       d  SU S3nU R                  S:w  a  US-  nU$ )Nr	  r  r   r  )rj  rH   r  r=   r   r  ri  )r   r  s     r>   r  Argument.make_metavar  sj    <<#<<ii##D)))//#C}}cU!*C::?5LC
rL   r|  r  c                     U(       d  U(       d  S / / 4$ [        S5      e[        U5      S:X  a'  US   =p4UR                  SS5      R                  5       nO[        S[        U5       S35      eX4// 4$ )Nz8Argument is marked as exposed, but does not have a name.r   r   r   r   z6Arguments take exactly one parameter declaration, got r  )r  r  r   r  )r   r|  r  r=   args        r>   rn  Argument._parse_decls  s     R|#VWWu:?q!D<<S)//1DJ<q"  UBrL   r.   c                 $    U R                  5       /$ rP   r  r;  s     r>   r   Argument.get_usage_pieces  s    !!#$$rL   c                 *    SU R                  5        S3$ )Nr  r6  r;  s     r>   r  Argument.get_error_hint  s    4$$&'q))rL   r  c                 N    UR                  U R                  U R                  U S9  g )N)r  ri  r   )add_argumentr=   ri  r  s      r>   r  Argument.add_to_parser  s    $**$GrL   rp   rP   )rI   rq   rr   rs   rt   rx  r4   r  r&  r%  rj   r'  r   r/  r  r  ri   r*  rn  r/   r   r  r   r  r|   r  r  s   @r>   r  r    s%    !O
 &*LZZ_L **T"L 	L
 
L L* !S ! !

c 
ZZ_48	
C!&&+qvvc{:	;"%G %s %*' *c *HL Hw H4 H HrL   r  r3  rP   )Xru   rz  r  rr  rp  typingr4   collectionsr   
contextlibr   r   	functoolsr   r   r   r   	itertoolsr	   r   r
   r   
exceptionsr   r   r   r   r   r   
formattingr   r   globalsr   r   r  r   r   r   termuir   r   r    utilsr!   r"   r#   r$   r%   r&   TYPE_CHECKINGtyping_extensionster  r(   r  r*   TypeVarr+  r'  r+   r-   r&  r.  ri   r?   rj   rK   Iterabler)  r*  rT   r%  rY   r  rl   Enumrn   r/   r4  r2   r6   r5  rW  rd  rV   r  r  rp   rL   r>   <module>rM     s      	 
   %   $        $ &  ( " % $   ! %       '   *  %??"&0IIcCJ/0IIcN$	$ #$ZZY'($( SX ,/6?KO	0:AJJqM :s :qvvaggafo7N : 59	::k2ZZ $3jj-3zz+.3 VVK36Adii A4Y
0 Y
0xD* D*N
zk zz	r7 rj	i%L i%X* *Zquu AEE!2 p? p?fGY GTIHy IHrL   