
    ]h_                      S SK Jr  S SKJr  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.J0r0  SSK.J1r1  SS K2J3r3  SS!K2J4r4  SS"K2J5r5  SS#K2J6r6  SS$K2J7r7  SS%K2J8r8  \Rr                  (       a  SS&K:J;r;  \Rx                  " S'S(S)9r=\Rx                  " S*5      r>      SIS, jr? SJ         SKS/ jjr@SLS0 jrA\ SM     SNS1 jj5       rB      SOS2 jrC " S3 S4\R                  5      rE " S5 S+5      rF " S6 S.5      rG " S7 S8\H5      rI " S9 S:\G\IS;9rJ " S< S-\G5      rK " S= S>\K\IS;9rL " S? S@\K5      rMSPSA jrN " SB SC5      rO " SD SE\O5      rP " SF SG\O5      rQSQSH jrRg)R    )annotationsN)abc)Counter)AbstractContextManager)contextmanager)	ExitStack)update_wrapper)gettext)ngettext)repeat)TracebackType   )typesAbort)BadParameter)ClickException)Exit)MissingParameter)NoArgsIsHelpError
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CompletionItemFt.Callable[..., t.Any])boundVContextc              #    #    [         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Groupcommandlist_commands
startswithget_commandhidden)ctx
incompletemultinamer5   s        </var/www/html/env/lib/python3.13/site-packages/click/core.py_complete_visible_commandsr?   5   se      FF5#++&E##C(??:&&''2G"7>>>m# )s   ABB*B=
Br4   Commandc                    U R                   (       a  [        U[        5      (       d  g U(       a  SU< SU R                  < S3nOSU< SU R                  < S3n[	        U5      e)Nz$It is not possible to add the group z to another group z that is in chain mode.zFound the group z! as subcommand to another group  z. that is in chain mode. This is not supported.)chain
isinstancer4   r=   RuntimeError)base_commandcmd_namecmdregistermessages        r>   _check_nested_chainrJ   H   sz     ZU%;%;28, ?"''**AC 	 xl +!!$$RT 	
 w
    c           	     P    [        [        [        [        U 5      U5      SS065      $ )NstrictF)listzipr   iter)iterable
batch_sizes     r>   batchrS   \   s"    VDNJ7FFGGrK   c              #     #     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:   paramr   )r:   rU   es      r>   augment_usage_errorsrW   `   sZ     
 55=EG 55=Es.   A&	 A&
A#*=A#
AA##A&c                &   ^  S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
c                   >  TR                  U 5      nU R                  (       + U4$ ! [         a    [        S5      n N*f = f)Ninf)index
ValueErrorfloatis_eager)itemidxinvocation_orders     r>   sort_key,iter_params_for_processing.<locals>.sort_key   sF    	)//5C == #%%  	,C	s   ' ??key)r_   	Parameterreturnztuple[bool, float])sorted)ra   declaration_orderrb   s   `  r>   iter_params_for_processingrj   s   s     & #22rK   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)__name__
__module____qualname____firstlineno____doc__enumautoCOMMANDLINEENVIRONMENTDEFAULTDEFAULT_MAPPROMPT__static_attributes__rn   rK   r>   rl   rl      sO     ))+K:))+K>iikG6))+KAYY[F@rK   rl   c                     \ rS rSr% Sr\rS\S'                  S%                                 S&S jjr\	S'S j5       r
S(S jrS)S	 jr        S*S
 jr\S+S,S jj5       r\	S(S j5       rS-S jrS.S jrS/S jrS0S jr\	S1S j5       rS)S jrS2S jrS3S jr\R4                   S+     S4S jj5       r\R4                   S5     S6S jj5       rS+S7S jjrS8S jrS9S jrS:S;S jjrS1S jrS1S jr S<S jr!\R4                          S=S j5       r"\R4                  S>S j5       r"        S?S  jr"S@S! jr#SAS" jr$SBS# jr%S$r&g)Cr0      aG  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.2
    The ``protected_args`` attribute is deprecated and will be removed in
    Click 9.0. ``args`` will contain remaining unparsed tokens.

.. 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.
ztype[HelpFormatter]formatter_classNc                ^   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Xl        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   ) parentr5   	info_nameparamsargs_protected_argsset_opt_prefixesobjgetattr_metadefault_mapgetinvoked_subcommandterminal_widthmax_content_widthallow_extra_argsallow_interspersed_argsignore_unknown_optionshelp_option_namestoken_normalize_funcresilient_parsingauto_envvar_prefixupperreplacecolorshow_default_close_callbacks_depth_parameter_sourcer   _exit_stack)selfr5   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s                    r>   __init__Context.__init__  sp   ( " )+!	
 +-DJs6+?+?'@PSPU;6-**C '.vvr'B
 %""". ,,00;KCN /3!f&8#22N +9$); & 8 8 .?#&77 !1"*&-&E&E# .E$!)%,%C%C" -C#$!$*$<$<!%-J! ->'F,>#)#>#>  DX!
 (9
 %"--9NN. 0014>>3G3G3I2JK # "4!9!9!;)!3!;!;C!E.@=V/LLE #(
F$6!..L *6=?=?$;rK   c                L    SS K nUR                  S[        SS9  U R                  $ )Nr   zo'protected_args' is deprecated and will be removed in Click 9.0. 'args' will contain remaining unparsed tokens.   
stacklevel)warningswarnDeprecationWarningr   )r   r   s     r>   protected_argsContext.protected_args  s/    >	 	 	
 ###rK   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
)r5   r   r   r   r   r   )r5   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
 	
rK   c                F    U =R                   S-  sl         [        U 5        U $ Nr   )r   r   r   s    r>   	__enter__Context.__enter__  s    qTrK   c                    U =R                   S-  sl         U R                   S:X  a  U R                  5         [        5         g Nr   r   )r   closer   )r   exc_type	exc_valuetbs       r>   __exit__Context.__exit__  s,     	q;;!JJLrK   c              #    #    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   cleanup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rK   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 $ 
 	
rK   c                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   context_managers     r>   with_resourceContext.with_resource;  s    6 --o>>rK   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   fs     r>   call_on_closeContext.call_on_closeX  s     ((++rK   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.closed  s     
 	 $;rK   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_pathrC   r5   r@   
get_paramsextendget_usage_piecesjoinlstrip)r   r   parent_command_pathrU   s       r>   r   Context.command_pathm  s     >>%B;;"#';;#;#;"<$++--w77![[00;;DAE'..u/E/Ed/KL B HH012!B48Byy{rK   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_root  s+    kk%;;D kk%rK   c                ~    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)rC   r   r   )r   object_typer   s      r>   find_objectContext.find_object  s=    #$((K00xx;;D	  rK   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	rK   c                    g Nrn   r   r=   calls      r>   lookup_defaultContext.lookup_default       rK   c                    g r   rn   r   s      r>   r   r          03rK   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rK   c                    [        X5      e)ztAborts the execution of the program with a specific error
message.

:param message: the error message to fail with.
r   )r   rI   s     r>   failContext.fail  s     ''rK   c                    [        5       e)zAborts the script.r   r   s    r>   abortContext.abort  s	    grK   c                8    U R                  5         [        U5      e)zExits the application with a given exit code.

.. versionchanged:: 8.2
    Callbacks and context managers registered with :meth:`call_on_close`
    and :meth:`with_resource` are closed before exiting.
)r   r   )r   codes     r>   exitContext.exit  s     	

4jrK   c                8    U R                   R                  U 5      $ )zQHelper method to get formatted usage string for the current
context and command.
)r5   	get_usager   s    r>   r  Context.get_usage  s     ||%%d++rK   c                8    U R                   R                  U 5      $ )zNHelper method to get formatted help page for the current
context and command.
)r5   get_helpr   s    r>   r  Context.get_help  s     ||$$T**rK   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   )typer=   )r   r5   s     r>   _make_sub_contextContext._make_sub_context  s     Dz'\\$GGrK   c                   g r   rn   r   r   r   kwargss       r>   invokeContext.invoke  s     rK   c                   g r   rn   r  s       r>   r  r    s    TWrK   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)a  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.

.. versionchanged:: 8.0
    All ``kwargs`` are tracked in :attr:`params` so they will be
    passed if :meth:`forward` is called at multiple levels.

.. versionchanged:: 3.2
    A new context is created, and missing arguments use default values.
Nz?The given command does not have a callback that can be invoked.t.Callable[..., V])rC   r@   r   	TypeErrorr2   r3   r  r   r=   expose_valuetype_cast_valueget_defaultupdaterW   )r   r   r   r  	other_cmdr:   rU   s          r>   r  r    s    ( h(( I!!)U  66"6	8J8JK((3C"))::V+0B0B0B).)>)>..s3*F::& * JJf%C!$'00  (' (''s$   /D(2D:	D(
D	D((
D6c                   [        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.)rC   r@   r  r   r  )r   rG   r   r  rU   s        r>   forwardContext.forward  s\     #w''899[[E" $E 2 ! {{30000rK   c                     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=   sources      r>   set_parameter_sourceContext.set_parameter_source/  s     (.t$rK   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_source8  s      %%))$//rK   )r   r   r   r   r   r   r   r   r   r   r   r   r5   r   r   r   r   r   r   r   r   r   r   r   r   r   )NNNNNNNFNNNNNNN)"r5   r@   r   Context | Noner   
str | Noner   t.Any | Noner   r&  r   &cabc.MutableMapping[str, t.Any] | Noner   
int | Noner   r)  r   boolr   bool | Noner   r+  r   r+  r   zlist[str] | Noner   zt.Callable[[str], str] | Noner   r+  r   r+  rg   None)rg   	list[str]rg   dict[str, t.Any])rg   r0   )r   ztype[BaseException] | Noner   zBaseException | Noner   zTracebackType | Nonerg   r,  T)r   r*  rg   zcabc.Iterator[Context])rg   r   )r   zAbstractContextManager[V]rg   r/   )r   r-   rg   r-   )rg   r,  rg   str)r   type[V]rg   zV | None)r   r3  rg   r/   )r=   r2  r   t.Literal[True]rg   r'  .)r=   r2  r   zt.Literal[False]rg   $t.Any | t.Callable[[], t.Any] | None)r=   r2  r   r*  rg   r'  )rI   r2  rg   
t.NoReturn)rg   r7  )r   )r   intrg   r7  )r5   r@   rg   r0   )r   r  r   t.Anyr  r9  rg   r/   )r   r@   r   r9  r  r9  rg   r9  )r   zCommand | t.Callable[..., V]r   r9  r  r9  rg   z	t.Any | V)rG   r@   r   r9  r  r9  rg   r9  )r=   r2  r  rl   rg   r,  )r=   r2  rg   zParameterSource | None)'ro   rp   rq   rr   rs   r   r~   __annotations__r   propertyr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r2   overloadr   r   r   r   r  r  r  r  r  r   r#  r{   rn   rK   r>   r0   r0      s   `J ,9O(8
 "& $ )->B%)(,"'(,/3.2.2>B!$(#h'h' h' 	h'
 h' 'h' <h' #h' &h'  h' &h' "-h' !,h' ,h' <h'  !h'" "#h'$ 
%h'T 	$ 	$
*
	,	 (	 !		
 
	 #! #!J  6
?:
,'  $
 ZZ15.	  ZZ2533/3	-3 3((,+H ZZ*6;GL	
  ZZW W.14.1@E.1QV.1	.1`1&.0rK   c                  R   \ rS rSr% Sr\rS\S'   SrSr	Sr
           S"                         S#S jjrS$S	 jrS%S
 jrS&S jrS'S jrS(S jrS)S jrS)S jrS*S jrS+S jrS&S jrS,S-S jjrS(S jrS(S jrS(S jrS(S jr S.         S/S jjrS0S jrS1S jrS2S jr\R@                      S3           S4S jj5       r!\R@                      S5           S6S jj5       r!     S7             S8S jjr! S.       S9S jjr"S:S  jr#S!r$g);r@   iK  a  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: If ``True`` or non-empty string, issues a message
                    indicating that the command is deprecated and highlights
                    its deprecation in --help. The message can be customized
                    by using a string as the value.

.. versionchanged:: 8.2
    This is the base class for all commands, not ``BaseCommand``.
    ``deprecated`` can be set to a string as well to customize the
    deprecation message.

.. 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.
ztype[Context]context_classFTNc                    Xl         Uc  0 nX l        X0l        U=(       d    / U l        XPl        X`l        Xl        Xpl        Xl        S U l	        Xl
        Xl        Xl        g r   )r=   context_settingsr   r   helpepilogoptions_metavar
short_helpadd_help_option_help_optionno_args_is_helpr9   
deprecated)r   r=   r@  r   r   rA  rB  rD  rC  rE  rG  r9   rH  s                r>   r   Command.__init__  sf    & 	#! BR ! (.|	.$. .$rK   c                    U R                   U R                  U5       Vs/ s H  o"R                  5       PM     snU R                  U R                  U R
                  U R                  U R                  S.$ s  snf )N)r=   r   rA  rB  rD  r9   rH  )r=   r   r   rA  rB  rD  r9   rH  )r   r:   rU   s      r>   r   Command.to_info_dict  s]    II9=9MN9M))+9MNIIkk//kk//
 	
Ns   A4c                P    SU R                   R                   SU R                   S3$ N<r   >	__class__ro   r=   r   s    r>   __repr__Command.__repr__  &    4>>**+1TYYKq99rK   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0rK   c                2   U R                   nU R                  U5      nUb  / UQUPn SS KnU VVs/ s H  oUR                    H  ofPM     M     nnn[	        U5      nS UR                  5        5       n	U	 H  n
UR                  SU
 S3SS9  M     U$ s  snnf )Nr   c              3  :   #    U  H  u  pUS :  d  M  Uv   M     g7f)r   Nrn   ).0optcounts      r>   	<genexpr>%Command.get_params.<locals>.<genexpr>  s     V4HjcETUIcc4Hs   	zThe parameter zM is used more than once. Remove its duplicate as parameters should be unique.   r   )r   get_help_optionr   optsr   itemsr   )r   r:   r   help_optionr   rU   r`  rf  opts_counterduplicate_optsduplicate_opts              r>   r   Command.get_params  s    **3/"+v+{+F%+BVEzzCzCVDB"4=LVL4F4F4HVN!/( 8O O  !   "0  Cs   B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>   rW  Command.format_usage  s3    
 **3/c..0@ArK   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.
)rC  r   r   r   )r   r:   r   rU   s       r>   rn  Command.collect_usage_pieces  sM     (,';';d""#__S)EIIe,,S12 * 	rK   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_updaterf  secondary_optsrN   )r   r:   	all_namesrU   s       r>   get_help_option_namesCommand.get_help_option_names  sR    --.	[[E''

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

Skipped if :attr:`add_help_option` is ``False``.

.. versionchanged:: 8.1.8
    The help option is now cached to avoid creating it multiple times.
Nr   )rh  )rx  rE  rF  
decoratorsrh  r   pop)r   r:   r   rh  s       r>   re  Command.get_help_option   sc     !66s; (<(< $/ *+D1 $ 1D   rK   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    s#__S)E, *rK   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.
rV  )r   format_helprX  rY  rZ  s      r>   r  Command.get_help"  s:    
 &&(	(!!#**400rK   c                   U R                   (       a!  [        R                  " U R                   5      nO*U R                  (       a  [	        U R                  U5      nOSnU R
                  (       aI  [        U R
                  [        5      (       a  SU R
                   S3OSn[        S5      R                  X#S9nUR                  5       $ )zPGets short help for the command or makes it by shortening the
long help string.
r   (DEPRECATED: )(DEPRECATED){text} {deprecated_message}textdeprecated_message)rD  inspectcleandocrA  r'   rH  rC   r2  r   formatstrip)r   limitr  r  s       r>   get_short_help_strCommand.get_short_help_str+  s     ??##DOO4DYY*499e<DD?? doos33  02# 
 23:: ; D zz|rK   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)rW  format_help_textformat_optionsformat_epilogrZ  s      r>   r  Command.format_helpB  s<     	#)c-C+3*rK   c                   U R                   b3  [        R                  " U R                   5      R                  S5      S   nOSnU R                  (       aI  [        U R                  [        5      (       a  SU R                   S3OSn[        S5      R                  X4S	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  )rA  r  r  	partitionrH  rC   r2  r   r  write_paragraphindentation
write_text)r   r:   r[  r  r  s        r>   r  Command.format_help_textS  s    99 ##DII.88>qADD?? doos33  02# 
 23:: ; D %%'&&($$T* )(  )(s   C  
C.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[  rf  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)rB  r  r  r  r  r  )r   r:   r[  rB  s       r>   r  Command.format_epilogw  sY    ;;%%dkk2F%%'&&($$V, )(	  )(s   A..
A<c                   U R                   R                  5        H  u  pVXT;  d  M  XdU'   M     U R                  " U 4X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)r@  rg  r>  r   
parse_args)r   r   r   r   extrare   r   r:   s           r>   make_contextCommand.make_context  sz    6 //557JC"c
 8   SSUSYYuY%OOC& &
 &%
s   A//
A>c           
     d   U(       d-  U R                   (       a  UR                  (       d  [        U5      e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   z&Got unexpected extra argument ({args})z'Got unexpected extra arguments ({args})r   )rG  r   r   r  r  rj   r   handle_parse_resultr   r   r   lenr  r   mapr2  r   r   r  )r   r:   r   r  rf  param_orderrU   r   s           r>   r  Command.parse_args  s    ,,S5J5J#C((!!#&"("3"3"3">K/__S=QRE33CtDKE4 S ,,S5J5JHH<=I &chhs3~6&7   !5!56rK   c                X   U R                   (       ae  [        U R                   [        5      (       a  SU R                    3OSn[        S5      R	                  U R
                  U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.
r   r   zFDeprecationWarning: The command {name!r} is deprecated.{extra_message})r=   extra_messageredfgTerrN)rH  rC   r2  r   r  r=   r&   r#   r   r  r   )r   r:   r  rI   s       r>   r  Command.invoke  s     ??)3DOOS)I)I!DOO$%r  Xf$))=fA  w5)t4==$::dmm:szz:: %rK   c                  ^^^^ SSK Jm  / nT(       a  TS   R                  5       (       d  U R                  T5       H  m[	        T[
        5      (       aN  TR                  (       d=  TR                  (       d.  T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     TR                  b{  TR                  m[	        TR                   ["        5      (       aA  TR                   R$                  (       a&  UR                  UU4S j['        TT5       5       5        TR                  b  M{  U$ )ao  Return a list of completions for the incomplete value. Looks
at the names of options and chained multi-commands.

Any command could be part of a chained multi-command, so sibling
commands are valid at any point during command completion.

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

.. versionadded:: 8.0
r   r*   c              3  v   >#    U  H.  nUR                  T5      (       d  M  T" UTR                  S 9v   M0     g7frA  N)r7   rA  )r_  r=   r+   r;   rU   s     r>   rb  )Command.shell_complete.<locals>.<genexpr>  s1       Dz2 :N4ejj9 Ds   99c              3  t   >#    U  H-  u  pUTR                   ;  d  M  T" XR                  5       S 9v   M/     g7fr  )r   r  )r_  r=   r5   r+   r:   s      r>   rb  r    s9      )T3#6#66 LN4.H.H.JK)Ts   88)click.shell_completionr+   isalnumr   rC   Optionr9   multipler#  r=   rl   rv   r   rf  rv  r   r5   r4   rB   r?   )r   r:   r;   resultsr+   rU   s    `` @@r>   shell_completeCommand.shell_complete  s    	:(*jm3355-"5&11||!NN44UZZ@*667   D%** Du/C/C D  .$ jj$**C#++u--#++2C2C )CC)T 	 jj$ rK   c                    g r   rn   r   r   	prog_namecomplete_varstandalone_moder  s         r>   mainCommand.main  s     rK   c                    g r   rn   r  s         r>   r  r    s     rK   c                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%   rN   r$   _main_shell_completionr  r  r   EOFErrorKeyboardInterruptr&   stderrr   r   show	exit_codeOSErrorerrnoEPIPEr2   r3   TextIOr)   stdoutr   r   )
r   r   r  r  r  windows_expand_argsr  r:   r   rV   s
             r>   r  r    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c                   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   )r  )	r   r   r  environr   shell_completionr  r  r   )r   ctx_argsr  r  complete_nameinstructionr  r   s           r>   r  Command._main_shell_completion  st    $ %--c37??SIM}oY7==?Ljjnn\24DI[QrK   c                &    U R                   " U0 UD6$ )zAlias for :meth:`main`.)r  r   r   r  s      r>   __call__Command.__call__  s    yy$)&))rK   )rF  rE  r   r@  rH  rB  rA  r9   r=   rG  rC  r   rD  )NNNNNNz	[OPTIONS]TFFF)r=   r&  r@  r(  r   t.Callable[..., t.Any] | Noner   zlist[Parameter] | NonerA  r&  rB  r&  rD  r&  rC  r&  rE  r*  rG  r*  r9   r*  rH  
bool | strrg   r,  r:   r0   rg   r/  r1  r:   r0   rg   r2  )r:   r0   rg   list[Parameter]r:   r0   r[  r   rg   r,  r:   r0   rg   r-  )r:   r0   rg   zOption | None)r:   r0   rg   r   )-   )r  r8  rg   r2  r   )
r   r&  r   r-  r   r%  r  r9  rg   r0   r:   r0   r   r-  rg   r-  r:   r0   rg   r9  r:   r0   r;   r2  rg   list[CompletionItem])NNNT)r   cabc.Sequence[str] | Noner  r&  r  r&  r  r4  r  r9  rg   r7  )NNN.)r   r  r  r&  r  r&  r  r*  r  r9  rg   r9  )NNNTT)r   r  r  r&  r  r&  r  r*  r  r*  r  r9  rg   r9  )r  zcabc.MutableMapping[str, t.Any]r  r2  r  r&  rg   r,  )r   r9  r  r9  rg   r9  )%ro   rp   rq   rr   rs   r0   r>  r:  r   r   r   r   r   rR  r  r   rW  rn  rx  re  r  r  r  r  r  r  r  r  r  r  r  r2   r<  r  r  r  r{   rn   rK   r>   r@   r@   K  s   -d $+M=*  # #
 DH26)-!!%&1 $ %!&*%*% A*% 0	*%
 '*% *% *% *% $*% *% *% *% *% 
*%X	
:12B	!61.+"+0
)- "&	## # 	#
 # 
#J.; -^ ZZ +/ $#'+/'  !	
 )  
  ZZ +/ $#' #'  !	
   
  +/ $#' $$(o'o o !	o
 o "o o 
oj $(	1  !	
 
@*rK   c                  (    \ rS rSrSS jrSS jrSrg)_FakeSubclassChecki  c                2    [        XR                  S   5      $ Nr   )
issubclass	__bases__)clssubclasss     r>   __subclasscheck__$_FakeSubclassCheck.__subclasscheck__      (MM!$455rK   c                2    [        XR                  S   5      $ r  )rC   r  )r  instances     r>   __instancecheck__$_FakeSubclassCheck.__instancecheck__  r	  rK   rn   N)r  r
  rg   r*  )r  r9  rg   r*  )ro   rp   rq   rr   r  r  r{   rn   rK   r>   r   r     s    66rK   r   c                      \ rS rSrSrSrg)_BaseCommandi  zP
.. deprecated:: 8.2
    Will be removed in Click 9.0. Use ``Command`` instead.
rn   Nro   rp   rq   rr   rs   r{   rn   rK   r>   r  r        rK   r  )	metaclassc                    ^  \ rS rSr% SrSrSrSrS\S'   Sr	S\S	'          S                 SU 4S
 jjjr
S U 4S jjrS!S"S jjr\R                  S#S j5       r\R                        S$S j5       r      S%S jr\R                  S&S j5       r\R                        S'S j5       r      S(S jrS)S*S jjrS+S jrS,S jrS,U 4S jjrS-U 4S jjrS-S jrS.U 4S jjrS/U 4S jjr      S0S jrS1U 4S jjrSrU =r$ )2r4   i  a  A group is a command that nests other commands (or more groups).

:param name: The name of the group command.
:param commands: Map names to :class:`Command` objects. Can be a list, which
    will use :attr:`Command.name` as the keys.
:param invoke_without_command: Invoke the group's callback even if a
    subcommand is not given.
:param no_args_is_help: If no arguments are given, show the group's help and
    exit. Defaults to the opposite of ``invoke_without_command``.
:param subcommand_metavar: How to represent the subcommand argument in help.
    The default will represent whether ``chain`` is set or not.
:param chain: Allow passing more than one subcommand argument. After parsing
    a command's arguments, if any arguments remain another command will be
    matched, and so on.
:param result_callback: A function to call after the group's and
    subcommand's callbacks. The value returned by the subcommand is passed.
    If ``chain`` is enabled, the value will be a list of values returned by
    all the commands. If ``invoke_without_command`` is enabled, the value
    will be the value returned by the group's callback, or an empty list if
    ``chain`` is enabled.
:param kwargs: Other arguments passed to :class:`Command`.

.. versionchanged:: 8.0
    The ``commands`` argument can be a list of command objects.

.. versionchanged:: 8.2
    Merged with and replaces the ``MultiCommand`` base class.
TFNztype[Command] | Nonecommand_classztype[Group] | type[type] | Nonegroup_classc                  > [         TU ]  " U40 UD6  Uc  0 nOJ[        U[        R                  5      (       a+  U V	s0 s H  oR
                  c  M  U	R
                  U	_M      nn	X l        Uc  U(       + nX@l        X0l        Uc  U(       a  SnOSnXPl	        X`l
        Xpl        U R                  (       aG  U R                   H6  n
[        U
[        5      (       d  M  U
R                  (       a  M-  [        S5      e   g g s  sn	f )Nz*COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...zCOMMAND [ARGS]...z5A group in chain mode cannot have optional arguments.)superr   rC   r   Sequencer=   commandsrG  invoke_without_commandsubcommand_metavarrB   _result_callbackr   ArgumentrequiredrD   )r   r=   r  r  rG  r  rB   result_callbackr  crU   rQ  s              r>   r   Group.__init__  s     	((H#,,//+3J8avv		8HJ <D""88O.&<#%%Q"%8""4
 !0::eX..u~~~&O  % / Ks   C9C9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)NFr  )r  rB   )r  r   r6   r8   r  r   r  rB   )r   r:   	info_dictr  r=   r5   sub_ctxrQ  s          r>   r   Group.to_info_dict  s    G(-	&&s+D&&s1G++G4Gu-!(!5!5g!> .- , 	(**=	 .-s   B
B'	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)rH   )r=   r  rJ   r  )r   rG   r=   s      r>   add_commandGroup.add_command+  s;     sxx<233Dd;!drK   c                    g r   rn   r   _Group__funcs     r>   r5   Group.command5  s    BErK   c                    g r   rn   r  s      r>   r5   r,  8  s     9<rK   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                  (       a!  TR                  S5      c  T R                  TS'   S	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   )r5   Nr   z7Use 'command(**kwargs)(callable)' to provide arguments.rn   r  c                F   > T" T0 TD6" U 5      nTR                  U5        U$ r   r'  )r   rG   r   r5   r  r   s     r>   	decorator Group.command.<locals>.decorator\  s*    "D3F3A6CS!JrK   )r   r-   rg   r@   )r{  r5   r   r  r  r   )r   r   r  funcr1  r5   s   ```  @r>   r5   r,  =  s    " 	(.2HT!W%%t9>& I0 GTD&**U"3"; ..F5M	 	
 T?"rK   c                    g r   rn   r*  s     r>   groupGroup.groupf  s    >ArK   c                    g r   rn   r  s      r>   r5  r6  i  s     7:rK   c                d  ^ ^^^ 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	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   )r5  Nr   z5Use 'group(**kwargs)(callable)' to provide arguments.rn   r  c                F   > T" T0 TD6" U 5      nTR                  U5        U$ r   r0  )r   rG   r   r5  r  r   s     r>   r1  Group.group.<locals>.decorator  s*    //2CS!JrK   )r   r-   rg   r4   )r{  r5  r   r  r  r   r
  )r   r   r  r3  r1  r5  s   ```  @r>   r5  r6  n  s    " 	&.2HT!W%%t9>& G0 GTD'FJJu,=,E4' $T
u $ 0 0u	 	
 T?"rK   c                   ^ ^ S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
c                   >^ ^ TR                   mTb  T(       a	  T Tl         T $ SU U4S j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$ r   rn   )r   r   r  innerr   old_callbacks       r>   function:Group.result_callback.<locals>.decorator.<locals>.function  s,    $U<T<V<0000rK   )r   r9  r   r9  r  r9  rg   r9  )r  r	   r2   r3   r,   )r   r@  r   r?  r   r   s   `  @r>   r1  (Group.result_callback.<locals>.decorator  sS    00L#w()%1 1 *8q(8KQ)OOD!BIrK   )r   r,   rg   r,   rn   )r   r   r1  s   `` r>   r  Group.result_callback  s    :	 	 rK   c                8    U R                   R                  U5      $ )zmGiven a context and a command name, this returns a :class:`Command`
object if it exists or returns ``None``.
)r  r   )r   r:   rF   s      r>   r8   Group.get_command  s     }}  **rK   c                ,    [        U R                  5      $ )zCReturns a list of subcommand names in the order they should appear.)rh   r  r   r:   s     r>   r6   Group.list_commands  s    dmm$$rK   c                \   > [         TU ]  U5      nUR                  U R                  5        U$ r   )r  rn  r  r  )r   r:   r   rQ  s      r>   rn  Group.collect_usage_pieces  s)    W)#.
		$))*	rK   c                F   > [         TU ]  X5        U R                  X5        g r   )r  r  format_commands)r   r:   r[  rQ  s      r>   r  Group.format_options  s    s.S,rK   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_  rG   s     r>   rb  (Group.format_commands.<locals>.<genexpr>  s     -NXcc#a&kkXs   Commands)r6   r8   r9   r  r  r   maxr  r  r   r  )	r   r:   r[  r  
subcommandrG   r  rowsrA  s	            r>   rL  Group.format_commands  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c                .  > U(       d-  U R                   (       a  UR                  (       d  [        U5      e[        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                  $ r   )rG  r   r   r  r  rB   r   r   )r   r:   r   restrQ  s       r>   r  Group.parse_args  sz    ,,S5J5J#C((w!#,::"&CH xx ,0!Hd12h)CxxrK   c           	       >^ ^ S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)	Nc                r   > TR                   b(  TR                  " TR                   U 40 TR                  D6n U $ r   )r  r  r   r   r:   r   s    r>   _process_result%Group.invoke.<locals>._process_result  s3    $$0

4#8#8%N3::NLrK   zMissing command.r   *TF)r   r   r   r   r9  rg   r9  )r   r  r  r  rB   r   r   r   resolve_commandr   r  r5   r  )
r   r:   r^  r   r   rF   rG   r$  contextsrQ  s
   ``       r>   r  Group.invoke  s   	 	
 ""** ,B*2D S HHQ)*+ 1$$0sxx0 
 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H6=!H	H63BI6	I?+I*I
H
H'	#H66
I
II
I(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c\  UR                  (       dK  [	        U5      S   (       a  U R                  X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(   r8   r   r   r    r  r   r   r  )r   r:   r   rF   original_cmd_namerG   s         r>   rb  Group.resolve_commandH  s     DG$$ s- ;333?//9H""31C ;s44(#A&*HHQ23::@Q:RSxD#ABx77rK   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*   r  )r  r+   r?   r  r   r  r  )r   r:   r;   r+   r=   r5   r  rQ  s          r>   r  Group.shell_completec  sa     	: "<C!L
!L 4&@&@&BC!L 	 
 	uw-c>?
s    A)r  rB   r  r  rG  r  )NNFNNFN)r=   r&  r  zAcabc.MutableMapping[str, Command] | cabc.Sequence[Command] | Noner  r*  rG  r+  r  r&  rB   r*  r  r  r  r9  rg   r,  r  r   )rG   r@   r=   r&  rg   r,  )r+  r-   rg   r@   )r   r9  r  r9  rg   z-t.Callable[[t.Callable[..., t.Any]], Command])r   r9  r  r9  rg   z7t.Callable[[t.Callable[..., t.Any]], Command] | Command)r+  r-   rg   r4   )r   r9  r  r9  rg   z+t.Callable[[t.Callable[..., t.Any]], Group])r   r9  r  r9  rg   z3t.Callable[[t.Callable[..., t.Any]], Group] | GroupF)r   r*  rg   zt.Callable[[F], F]r:   r0   rF   r2  rg   zCommand | Noner  r  r  r  )r:   r0   r   r-  rg   z,tuple[str | None, Command | None, list[str]]r  )ro   rp   rq   rr   rs   r   r   r  r:  r  r   r   r'  r2   r<  r5   r5  r  r8   r6   rn  r  rL  r  r  rb  r  r{   __classcell__rQ  s   @r>   r4   r4     s   : # +/M'. 48K07
   ','+)-9=... !%. %. '. . 7. . 
. .`$" ZZE EZZ<<&+<	6< <''&+'	@'R ZZA AZZ::&+:	4: :**&+*	<*X+Z+%
--8B'H88"+8	586 rK   c                      \ rS rSrSrSrg)_MultiCommandiw  zN
.. deprecated:: 8.2
    Will be removed in Click 9.0. Use ``Group`` instead.
rn   Nr  rn   rK   r>   rp  rp  w  r  rK   rp  c                  p   ^  \ rS rSrSr  S       S	U 4S jjjrS
S jrSU 4S jjrSU 4S jjrSr	U =r
$ )CommandCollectioni~  a  A :class:`Group` that looks up subcommands on other groups. If a command
is not found on this group, each registered source is checked in order.
Parameters on a source are not added to this group, and a source's callback
is not invoked when invoking its commands. In other words, this "flattens"
commands in many groups into this one group.

:param name: The name of the group command.
:param sources: A list of :class:`Group` objects to look up commands from.
:param kwargs: Other arguments passed to :class:`Group`.

.. versionchanged:: 8.2
    This is a subclass of ``Group``. Commands are looked up first on this
    group, then each of its sources.
c                H   > [         TU ]  " U40 UD6  U=(       d    / U l        g r   )r  r   sources)r   r=   rt  r  rQ  s       r>   r   CommandCollection.__init__  s"     	(($+MrrK   c                :    U R                   R                  U5        g)z$Add a group as a source of commands.N)rt  r  )r   r5  s     r>   
add_sourceCommandCollection.add_source  s    E"rK   c                   > [         TU ]  X5      nUb  U$ U R                   H8  nUR                  X5      nUc  M  U R                  (       a  [	        XU5        Us  $    g r   )r  r8   rt  rB   rJ   )r   r:   rF   r   r  rQ  s        r>   r8   CommandCollection.get_command  sZ    W />IllF##C2B~::';	 # rK   c                   > [        [        TU ]	  U5      5      nU R                   H#  nUR	                  UR                  U5      5        M%     [        U5      $ r   )r   r  r6   rt  r  rh   )r   r:   r   r  rQ  s       r>   r6   CommandCollection.list_commands  sH    57056llFIIf**3/0 # bzrK   )rt  )NN)r=   r&  rt  zlist[Group] | Noner  r9  rg   r,  )r5  r4   rg   r,  rl  r  )ro   rp   rq   rr   rs   r   rw  r8   r6   r{   rm  rn  s   @r>   rr  rr  ~  sT    "  &*22 $2 	2
 
2 2#" rK   rr  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.
)rC   r2  r  rP   )r   s    r>   _check_iterr~    s      %;rK   c                     \ rS rSrSrSr             S                           SS jjrSS jrSS jr      SS jr	\
SS	 j5       rS S
 jr\R                   S!     S"S jj5       r\R                   S#     S$S jj5       r S!     S$S jjrS%S jr      S&S jrS'S jrS(S jrS'S jrS)S jrS*S jr        S+S jrS,S jrS-S jrS S jrS.S jrSrg)/rf   i  ac  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.
:param deprecated: If ``True`` or non-empty string, issues a message
                    indicating that the argument is deprecated and highlights
                    its deprecation in --help. The message can be customized
                    by using a string as the value. A deprecated parameter
                    cannot be required, a ValueError will be raised otherwise.

.. versionchanged:: 8.2.0
    Introduction of ``deprecated``.

.. versionchanged:: 8.2
    Adding duplicate parameter names to a :class:`~click.core.Command` will
    result in a ``UserWarning`` being shown.

.. versionchanged:: 8.2
    Adding duplicate parameter names to a :class:`~click.core.Command` will
    result in a ``UserWarning`` being shown.

.. 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.
	parameterNc           	     `   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        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bd  U(       a   [-        [/        U5      S 5      nUS:w  aA  Ub>   [/        U5        US:  a,  [3        U5      U:w  a  U(       a  S
OSn[)        SU SU S35      eU(       a;  U(       a3  [)        SU R4                   SU R6                   SU R4                   S35      eg g ! [0         a    [)        S5      S ef = f! [0         a    U(       a  SnOS	n[)        U5      S ef = f)Nrn   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=zThe z 'z1' is deprecated and still required. A deprecated z cannot be required.)_parse_declsr=   rf  rv  r   convert_typer
  is_compositearityr  r   nargsr  r  defaultr^   metavarenvvar_custom_shell_completerH  r\   r   nextr~  r  r  param_type_namehuman_readable_name)r   param_declsr
  r  r  r   r  r  r  r  r^   r  r  rH  check_defaultrI   subjects                    r>   r   Parameter.__init__  s1   & 	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  J 4//043K3K2L MF++,,@B  'x5 % $(O#$$ % 	<#!: $
 'TG(1t;	<s   G0 0H
 0H
#H-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=   r  rf  rv  r
  r  r  r  r  r  )r=   r  rf  rv  r
  r   r  r  r  r  r  r   s    r>   r   Parameter.to_info_dict{  sa     II#33II"11II**,ZZ||kk
 	
rK   c                P    SU R                   R                   SU R                   S3$ rM  rP  r   s    r>   rR  Parameter.__repr__  rT  rK   c                    [        5       er   NotImplementedError)r   declsr  s      r>   r  Parameter._parse_decls  s     "##rK   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.
rf  r   s    r>   r  Parameter.human_readable_name  s    
 yyrK   c                    U R                   b  U R                   $ U R                  R                  XS9nUc$  U R                  R                  R	                  5       nU R
                  S:w  a  US-  nU$ )NrU   r:   r   ...)r  r
  get_metavarr=   r   r  )r   r:   r  s      r>   make_metavarParameter.make_metavar  sb    <<#<<))''d'<?iinn**,G::?uGrK   c                    g r   rn   r   r:   r   s      r>   r  Parameter.get_default  r   rK   c                    g r   rn   r  s      r>   r  r    r   rK   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=   r  r   )r   r:   r   r   s       r>   r  r    sB    . ""4995"9=LLEHUOOGErK   c                    [        5       er   r  r   r  r:   s      r>   r  Parameter.add_to_parser  s    !##rK   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$ r   )
r   r=   rl   rv   value_from_envvarrw   r   ry   r  rx   )r   r:   rf  r   r  s        r>   consume_valueParameter.consume_value  s     # ,,=**3/E$00F=&&tyy1E$00F=$$S)E$,,F}rK   c                  ^ ^^^ Uc%  T R                   (       d  T R                  S:X  a  S$ S$ S
UU 4S jjmT R                  S:X  d  T R                  R                  (       a
  SUU 4S jjmO%T R                  S:X  a  SUUU 4S jjmO
S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`.
Nrn   c                b   >  [        U 5      $ ! [         a    [        [        S5      TTS9S ef = f)NzValue must be an iterable.r:   rU   )r~  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$ )Nr  r
  r]  s    r>   convert*Parameter.type_cast_value.<locals>.convert	  s    yydy<<rK   c                <   > [        UU4S jT" U 5       5       5      $ )Nc              3  J   >#    U  H  nTR                  UTT5      v   M     g 7fr   r  r_  xr:   r   s     r>   rb  =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PrK   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.)r  r  r  c              3  J   >#    U  H  nTR                  UTT5      v   M     g 7fr   r  r  s     r>   rb  r  	  s!     DeTYYq$44er  )r  r  r  r   r   r  r  s    r>   r  r  	  su    j/0u:+& CHJ !&tzzs5z&B"  DeDDDrK   c              3  4   >#    U  H  nT" U5      v   M     g 7fr   rn   )r_  r  r  s     r>   rb  ,Parameter.type_cast_value.<locals>.<genexpr>	  s     ?->->s   r   r9  rg   zcabc.Iterator[t.Any]ra  )r  r  r
  r  r  )r   r:   r   r  r  s   `` @@r>   r  Parameter.type_cast_value  s     =$***:2DD		 		 ::?dii44= = ZZ2Q Q
E E  ==?Z->???u~rK   c                \    Uc  gU R                   S:w  d  U R                  (       a  US:X  a  gg)NTr   rn   F)r  r  )r   r   s     r>   value_is_missingParameter.value_is_missing#	  s'    =JJ!Ot}}%2+rK   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_value,	  sS    $$S0==T22599"s77==$MM#U3ErK   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 r   )r  rC   r2  r  r  r   )r   r:   r   r  s       r>   resolve_envvar_valueParameter.resolve_envvar_value7	  sy    ;;dkk3'',B	   ++ZZ^^F+2I	 & rK   c                    U R                  U5      nUb+  U R                  S:w  a  U R                  R                  U5      nU$ r   )r  r  r
  split_envvar_value)r   r:   r   s      r>   r  Parameter.value_from_envvarI	  s:    44S9>djjAo--b1B	rK   c                   [        XS9   U R                  X5      u  pEU R                  (       a  Ub  U[        R                  [        R
                  4;  ap  [        U R                  [        5      (       a  SU R                   3OSn[        S5      R                  U R                  U R                  US9n[        [        USS9SS	9  U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   r   r   zKDeprecationWarning: The {param_type} {name!r} is deprecated.{extra_message})
param_typer=   r  r  r  Tr  )rW   r  rH  rl   rx   ry   rC   r2  r   r  r  r  r&   r#   r   r=   r  	Exceptionr   r  r   )r   r:   rf  r   r   r  r  rI   s           r>   r  Parameter.handle_parse_resultQ	  sC    "#2 ..s9ME %#++#// .8-M-Ma()SU  & &#3311"/    U7u-48$$TYY7**369 3F $)CJJtyy!d{  ,,	; 32s*   CE#D**EE
EE
Ec                    g r   rn   rG  s     r>   r  Parameter.get_help_record|	  s    rK   c                    / $ r   rn   rG  s     r>   r   Parameter.get_usage_pieces	  s    	rK   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)'Nrn   )r_  r  s     r>   rb  +Parameter.get_error_hint.<locals>.<genexpr>	  s     6IqAaS(Is   )rf  r  r   )r   r:   	hint_lists      r>   get_error_hintParameter.get_error_hint	  s0     II;$":":!;	zz6I666rK   c                (   U R                   be  U R                  XU5      nU(       a5  [        US   [        5      (       a  SSKJn  U Vs/ s H
  oT" U5      PM     nn[
        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  )	r  rC   r2  r  r+   r2   r3   r
  r  )r   r:   r;   r  r+   r   s         r>   r  Parameter.shell_complete	  s     &&211#ZHG:gaj#66A6=>g>!,g>660'::yy'':>>	 ?s   	B)r  r   r  rH  r  r  r^   r  r  r=   r  rf  r  rv  r
  )NNFNNNFNTFNNF)r  r  r
  types.ParamType | t.Any | Noner  r*  r  r6  r   z5t.Callable[[Context, Parameter, t.Any], t.Any] | Noner  r)  r  r*  r  r&  r  r*  r^   r*  r  zstr | cabc.Sequence[str] | Noner  zNt.Callable[[Context, Parameter, str], list[CompletionItem] | list[str]] | NonerH  r  rg   r,  r.  r1  r  cabc.Sequence[str]r  r*  rg   z'tuple[str | None, list[str], list[str]]r  r0  r:   r0   r   r4  rg   r'  r5  r:   r0   r   r*  rg   r6  r  r   r:   r0   rg   r,  )r:   r0   rf  cabc.Mapping[str, t.Any]rg   tuple[t.Any, ParameterSource])r:   r0   r   r9  rg   r9  )r   r9  rg   r*  r:   r0   rg   r&  r:   r0   rg   r'  )r:   r0   rf  r  r   r-  rg   ztuple[t.Any, list[str]]r:   r0   rg   ztuple[str, str] | Noner  r  )ro   rp   rq   rr   rs   r  r   r   rR  r  r;  r  r  r2   r<  r  r  r  r  r  r  r  r  r  r  r   r  r  r{   rn   rK   r>   rf   rf     s   Wr "O 26/38<JN "!26 !&#].] -] 	]
 6] H] ] ] ] ] ] 0]]" #]$ 
%]~
,:$'$7;$	0$
   ZZ48"1	  ZZ),33"&3	-3 3
 *."&	-B$":	&(1f	$))":)BK)	 )V7?rK   rf   c                    ^  \ rS rSrSrSr                 S                                     SU 4S jjjrSU 4S jjrSU 4S jjr      SS jr	SS jr
SS	 jrSS
 jr\R                   S     SS jj5       r\R                   S     SS jj5       r S     SU 4S jjjrSS jrS U 4S jjrS!S jr      S"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 and error messages.
    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. A deprecated option cannot be
    prompted.
: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.2
    ``envvar`` used with ``flag_value`` will always use the ``flag_value``,
    previously it would use the value of the environment variable.

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

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

.. versionchanged:: 8.1
    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.
optionc                  > U(       a  [         R                  " U5      nSU;  n[        TU ]  " U4XUS.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(       a'  [        U[        5      (       a  SU S	3OS
nUb  UU-   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(       a  Uc  U R&                  (       + nU   U(       a  Uc  [(        R*                  " S U5      U l        Xpl        U=(       a$    [        U R,                  [(        R0                  5      U l        Xl        Xl        U
(       a*  Uc  [(        R8                  " SS9U l        U(       a  SU l        Xl        Xl        X l        Xl         UU l!         U(       a  U(       a  [E        S5      eU RF                  S:X  a  [        S5      eU R                  (       a-  U R.                  (       a  U R2                  (       d  [        S5      eU R2                  (       d  U R"                  (       a  [        S5      eU R2                  (       a)  U R                  (       a  U R                  b  [        S5      eU R6                  (       a9  U RH                  (       a  [        S5      eU R.                  (       a  [        S5      eg g )Nr  )r
  r  rH  Tz&'name' is required with 'prompt=True'.r   r   Fr  r  r  rn   r   )minz)`deprecated` options cannot use `prompt`.r  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   
capitalizerC   r2  r"   confirmation_promptprompt_required
hide_inputr9   r   r*  rv  r  r  r   r  r
  is_flagBoolParamTypeis_bool_flag
flag_valuera  IntRangeallow_from_autoenvrA  r   show_choicesshow_envvarr\   r  r  )r   r  r   r"   r  r  r  r  r  r  ra  r  r
  rA  r9   r   r  rH  attrsdefault_is_missingprompt_textr  rQ  s                         r>   r   Option.__init__	  s   * ##D)D&e3	
"*	
PU	
 T>yy  HII&*ii&7&7S&A&L&L&NKu_K K j#..  
|1-# 
 150@4,,FXD!#6 .$ "&D!8!UAUAU=U?%'' t223d&<&< &0t%;D")$--!$z)!\\)Jt| **4<DI$")"XjEDWDW.X!+ 
|!NNq1	! "4	((&f !LMMzzR HII{{t||D4E4E MNN$$)<)< STT  T__9PO  zz==#$KLL<<#$JKK  	 rK   c           	        > [         TU ]  5       nUR                  U R                  U R                  U R
                  U R                  U R                  U R                  S9  U$ )N)rA  r"   r  r  ra  r9   )	r  r   r  rA  r"   r  r  ra  r9   )r   r#  rQ  s     r>   r   Option.to_info_dicti
  sU    G(*	;;LL**;; 	 	
 rK   c                n   > [         TU ]  U5      nU R                  (       a  USU R                   S3-  nU$ )Nz (env var: 'z'))r  r  r  r  )r   r:   resultrQ  s      r>   r  Option.get_error_hintu
  s7    ',T[[M44FrK   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      * $ r  rQ  )r  s    r>   <lambda>%Option._parse_decls.<locals>.<lambda>
  s    s1Q4yjrK   rd   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  splitrY  r  r    r   r\   sortr   lower)r   r  r  rf  rv  r=   possible_namesdecl
split_charfirstseconds              r>   r  Option._parse_decls{
  s    D  ""##fTF/$BCC$(!HOS
%$(JJz1$=ME!LLNE&--j.?@E*#]]_F&--fmmo>(-dX 69 9  ' #))*T*:;KK%/ 2 <N$89!!$Q'//S9??AD$$&&<T11H	R  N<TF C((,vR1  >))rK   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  ra  store_constT)r   rf  destactionconstF)r   rf  r  r  r  )
r  ra  r  r  rv  
add_optionrf  r=   r  r  )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  rK   c                  ^ ^^ T R                   (       a  g SmSU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T R                  T5      n/ nSU;   a9  UR                  [        S5      R                  SR                  US   5      S95        SU;   a*  UR                  [        S	5      R                  US   S
95        SU;   a  UR                  US   5        SU;   a  UR                  [        U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$ )NFc                   > [        U 5      u  pU(       a  SmTR                  (       d&  TR                  (       d  USTR                  TS9 3-  nU$ )NTr   )r:   )r   r  ra  r  )rf  r   any_slashesany_prefix_is_slashr:   r   s      r>   _write_opts+Option.get_help_record.<locals>._write_opts
  sL     +40OB&*#<<

$+++4566IrK   r   envvarszenv var: {var}, )varr  zdefault: {default})r  ranger  z; z  [][r  )rf  r  rg   r2  )	r9   rf  rv  r  rA  get_help_extrar   r  r   )	r   r:   r'  r   rA  r  extra_items	extra_strr&  s	   ``      @r>   r  Option.get_help_record
  sb   ;;#	 	 $))$%IIk$"5"567yyB##C("#**tyyy9I/J*K q!56==eIFV=WXeuW~.qz!234		+.I/3dV3yk+1YKq9ID+<<R@$FFrK   c                   0 nU R                   (       a  U R                  nUcT  U R                  (       aC  UR                  b6  U R                  b)  UR                   SU R                  R                  5        3nUb1  [        U[        5      (       a  U4US'   O[        S U 5       5      US'   UR                  nSUl	         U R                  USS9nXAl	        SnSnU R                  b0  [        U R                  [        5      (       a  S=pvO&U R                  nOUR                  b  UR                  nU(       d  U(       Ga  UGb  U(       a  SU R                   S3nO[        U[        [        45      (       a  S	R                  S
 U 5       5      nO[        R                  " U5      (       a  [!        S5      nOU R"                  (       a@  U R$                  (       a/  ['        U(       a  U R(                  OU R$                  S   5      S   nO@U R"                  (       a  U R$                  (       d
  U(       d  SnOUS:X  a  SnO[        U5      nU(       a  XS'   [        U R*                  [,        R.                  5      (       ag  U R0                  (       a1  U R*                  R2                  S:X  a  U R*                  R4                  b%  U R*                  R7                  5       n	U	(       a  XS'   U R8                  (       a  SUS'   U$ ! XAl	        f = f)Nr   r)  c              3  8   #    U  H  n[        U5      v   M     g 7fr   r2  r_  ds     r>   rb  (Option.get_help_extra.<locals>.<genexpr>  s     ,DVSVVV   TFr  (r  r*  c              3  8   #    U  H  n[        U5      v   M     g 7fr   r5  r6  s     r>   rb  r8  4  s     *I=a3q66=r9  z	(dynamic)r   r   r   z""r  r,  r  )r  r  r  r   r=   r   rC   r2  r  r   r  r   rN   r   r  
isfunctionr   r  rv  r    rf  r
  r   _NumberRangeBasera  r  rT  _describe_ranger  )
r   r:   r  r  	resilientdefault_valuer   show_default_is_strdefault_string	range_strs
             r>   r/  Option.get_help_extra  sq   ')[[F~++..:		- # 6 67q9J8KLF!fc**(.yE)$',,DV,D'DE)$
 ))	 $	. ,,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#1i  tyy%"8"899ZZDIIMMQ$6499==;P		113I!*g== *E*c %.!s   ?K9 9Lc                    g r   rn   r  s      r>   r  Option.get_defaultV  r   rK   c                    g r   rn   r  s      r>   r  rF  [  r   rK   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  r5   r   r=   r  r2   r3   r  r  r  r  )r   r:   r   rU   rQ  s       r>   r  rF  `  so     << 1 1++::*u}}}66&%0;;; , w"3"22rK   c           
       ^ ^ T R                   c   eT R                  T5      nT R                  (       a  [        T R                   U5      $ 0 n[	        T R
                  [        5      (       a  T R
                  US'   [        T R                   4UT R                  T R                  T R                  T R                  UU 4S jS.UD6$ )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.
r   c                (   > TR                  TU 5      $ r   )r  )r  r:   r   s    r>   r  )Option.prompt_for_value.<locals>.<lambda>  s    !3!3C!;rK   )r  r
  r  r   r  
value_proc)r"   r  r  r!   rC   r   r*  r
  r  r   r  )r   r:   r  prompt_kwargss   ``  r>   prompt_for_valueOption.prompt_for_valuep  s     {{&&& ""3' 4;;00  "d''..,0,=,=M.)KK	
** $ 8 8;	
 	
 		
rK   c                  > [         TU ]  U5      nUb9  U R                  (       a&  U R                  (       a  [	        U R                  5      $ 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  r2  r  r   r=   r   r  r  r   )r   r:   r   r  rQ  s       r>   r  Option.resolve_envvar_value  s    W)#.>||4??++I ##&&2		%../q1B0CDF'B	rK   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  r  r*  r  r
  r  rS   )r   r:   r   value_depths       r>   r  Option.value_from_envvar  st    44S9:zzQ$t}}*==?--b1B}}q2zz*	rK   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                  (       aS  UbP  [        S U 5       5      (       a9  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  0   #    U  H  o[         L v   M     g 7fr   r   )r_  vs     r>   rb  'Option.consume_value.<locals>.<genexpr>  s     :Eq**Es   )r  r  r   r"   r   rN  rl   rz   r  rv   r  anyrx   r  r  )r   r:   rf  r   r  rW  rQ  s         r>   r  Option.consume_value  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  ra  r  r  rA  r9   r  r  r  r"   r  r   r   r  r
  )NNFFTFNNFFTNNFTFF)&r  r  r   zbool | str | Noner"   r  r  r  r  r*  r  r*  r  r+  r  r'  r  r*  ra  r*  r  r*  r
  r  rA  r&  r9   r*  r   r*  r  r*  rH  r  r  r9  rg   r,  r.  r  r  r  r  )r:   r0   rg   ztypes.OptionHelpExtrar0  r  r5  r  r  r  r  )r:   r0   rf  zcabc.Mapping[str, Parameter]rg   r  )ro   rp   rq   rr   rs   r  r   r   r  r  r  r  r/  r2   r<  r  rN  r  r  r  r{   rm  rn  s   @r>   r  r  	  s1   ?B O 26*."*/ $ ##'#'/3!!!&%BL.BL (BL 	BL
 (BL BL BL BL !BL BL BL !BL -BL BL BL  !BL" #BL$ %BL& 'BL( 
)BL BLH
5*'5*7;5*	05*n%N+GZN` ZZ48"1	  ZZ),33"&3	-3 3
 *.33"&3	-3 3 
B* ##">#	&# #rK   r  c                     ^  \ rS rSrSrSr S       SU 4S jjjr\SS j5       rSS jr	      SS jr
SS jrSS	 jrS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`.
argumentc                   > 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 )Nr  Fr  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   r  r  )r   r  r  r  rQ  s       r>   r   Argument.__init__  s     yy#/  99Wa014WXXAxA5A||'DJJ",< JKK -='rK   c                h    U R                   b  U R                   $ U R                  R                  5       $ r   )r  r=   r   r   s    r>   r  Argument.human_readable_name  s'    <<#<<yy  rK   c                0   U R                   b  U R                   $ U R                  R                  XS9nU(       d  U R                  R	                  5       nU R
                  (       a  US-  nU R                  (       d  SU S3nU R                  S:w  a  US-  nU$ )Nr  !r.  r-  r   r  )r  r
  r  r=   r   rH  r  r  )r   r:   r+  s      r>   r  Argument.make_metavar  s}    <<#<<ii##$#8))//#C??3JC}}cU!*C::?5LC
rK   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U 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 z: r  )r  r  r   r  )r   r  r  r=   args        r>   r  Argument._parse_decls  s     R|#VWWu:?q!D<<S)//1DJ<r%+  UBrK   c                &    U R                  U5      /$ r   r  rG  s     r>   r   Argument.get_usage_pieces   s    !!#&''rK   c                ,    SU R                  U5       S3$ )Nr  rh  rG  s     r>   r  Argument.get_error_hint#  s    4$$S)*!,,rK   c                N    UR                  U R                  U R                  U S9  g )N)r  r  r   )add_argumentr=   r  r  s      r>   r  Argument.add_to_parser&  s    $**$GrK   rn   r   )r  r  r  r+  r  r9  rg   r,  r1  r  r  r  r  )ro   rp   rq   rr   rs   r  r   r;  r  r  r  r   r  r  r{   rm  rn  s   @r>   r  r    s     !O
 !%L'L L 	L
 
L L* ! !
'7;	0"(-H HrK   r  c                    SS K nU S:X  a  UR                  S[        SS9  [        $ U S:X  a  UR                  S[        SS9  [        $ [        U 5      e)Nr   BaseCommandzT'BaseCommand' is deprecated and will be removed in Click 9.0. Use 'Command' instead.r   r   MultiCommandzS'MultiCommand' is deprecated and will be removed in Click 9.0. Use 'Group' instead.)r   r   r   r  rp  AttributeError)r=   r   s     r>   __getattr__rs  *  sh    }"	 	 	
 ~ 	 	 	
 

rK   )r:   r0   r;   r2  rg   z"cabc.Iterator[tuple[str, Command]]rk  )
rE   r4   rF   r2  rG   r@   rH   r*  rg   r,  )rQ   zcabc.Iterable[V]rR   r8  rg   zlist[tuple[V, ...]]r   )r:   r0   rU   zParameter | Nonerg   zcabc.Iterator[None])ra   cabc.Sequence[Parameter]ri   rt  rg   r  r  )r=   r2  rg   object)S
__future__r   collections.abcr   cabcrt   r  r  r  r  typingr2   collectionsr   
contextlibr   r   r   	functoolsr	   r
   r   r   	itertoolsr   r   r   r   
exceptionsr   r   r   r   r   r   r   
formattingr   r   globalsr   r   r  r   r   r    termuir!   r"   r#   utilsr$   r%   r&   r'   r(   r)   TYPE_CHECKINGr  r+   TypeVarr,   r/   r?   rJ   rS   rW   rj   Enumrl   r0   r@   r
  r   r  r4   rp  rr  r~  rf   r  r  rs  rn   rK   r>   <module>r     s   "     	 
    - %   $        $ &  ( ) " % $   ! % !     '   *  %??0IIc12IIcN$	$!$'$( HM  #& -4 @D 	 (H ,0	) $3.3/3 36Adii A4`
0 `
0FW	* W	*t6 67&8 @G @FE%7 5 5p^? ^?BxY xvKHy KH\rK   