%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/click/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/click/__pycache__/core.cpython-312.pyc

�

D�d�����ddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZddlm
Z
ddlmZddlmZddlmZdd	lmZd
dlmZd
dlmZd
d
lmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dl m!Z!d
dl m"Z"d
dl#m$Z$d
dl#m%Z%d
dl#m&Z&d
dl'm(Z(d
dl'm)Z)d
dl'm*Z*d
dl+m,Z,d
dl+m-Z-d
dl+m.Z.d
dl+m/Z/d
d l+m0Z0d
d!l+m1Z1ejdr
ddl3Z4d
d"l5m6Z6ejnd#ejpd$ejrf�%�Z:ejnd&�Z;d'd(d)e<d*ejzej|e<d+ffd,�Z?	dNd-d.d/e<d0d+d1e@d*df
d2�ZAd3ej�e;d4eCd*ej�ej|e;d$ffd5�ZEe
	dOd'd(d6ej�d7d*ejzdfd8��ZGd9ej�d7d:ej�d7d*ej�d7fd;�ZIGd<�d=ej��ZKGd>�d(�ZLGd?�d@�ZMGdA�d+eM�ZNGdB�d.eN�ZOGdC�dDeO�ZPGdE�dFeO�ZQdGejrd*ejzejrfdH�ZRGdI�d7�ZSGdJ�dKeS�ZTGdL�dMeS�ZUy)P�N)�abc)�contextmanager)�	ExitStack)�update_wrapper)�gettext)�ngettext)�repeat)�
TracebackType�)�types��Abort)�BadParameter)�ClickException��Exit)�MissingParameter��
UsageError)�
HelpFormatter)�join_options)�pop_context)�push_context��_flag_needs_value)�OptionParser)�	split_opt)�confirm)�prompt)�style)�_detect_program_name)�_expand_args)�echo)�make_default_short_help)�make_str)�PacifyFlushWrapper��CompletionItem�F.)�bound�V�ctx�Context�
incomplete�return�Commandc#��K�tjt|j�}|j	|�D]<}|j|�s�|j
||�}|��*|jr�7||f���>y�w)z�List all the subcommands of a group that start with the
    incomplete value and aren't hidden.

    :param ctx: Invocation context for the group.
    :param incomplete: Value being completed. May be empty.
    N)�t�cast�MultiCommand�command�
list_commands�
startswith�get_command�hidden)r,r.�multi�namer5s     �,/usr/lib/python3/dist-packages/click/core.py�_complete_visible_commandsr=0sj����
�F�F�<����-�E��#�#�C�(�$���?�?�:�&��'�'��T�2�G��"�7�>�>��G�m�#�$�s�A
A8�
A8�"A8�/	A8�base_commandr4�cmd_name�cmd�registerc��|jrt|t�sy|rd}nd}t|�d|j�d|�d|�dt|�j�dt|�j�d|j�d	���)
NzdIt is not possible to add multi commands as children to another multi command that is in chain mode.zdFound a multi command as subcommand to a multi command that is in chain mode. This is not supported.z
. Command z is set to chain and zA was added as a subcommand but it in itself is a multi command. (z is a z within a chained z named z).)�chain�
isinstancer4�RuntimeErrorr;�type�__name__)r>r?r@rA�hints     r<�_check_multicommandrICs������Z��\�%B���
<�	
�
=�	
���&�
�<�,�,�/�0��<��$�<�v�d�3�i�.@�.@�-A�
�T�,�/�8�8�9�:���� ��		$����iterable�
batch_sizec	�J�tttt|�|���S�N)�list�zipr	�iter)rKrLs  r<�batchrR[s����V�D��N�J�7�8�9�9rJ�param�	Parameterc#��K�	d��y#t$r.}|j�||_|�|j�||_�d}~wt$r}|j�||_�d}~wwxYw�w)z>Context manager that attaches extra information to exceptions.N)rr,rSr)r,rS�es   r<�augment_usage_errorsrW_sa����
�
�����5�5�=��A�E��������A�G�
�����5�5�=��A�E�
���s.�A#�	�A#�	A �);�A �A�A � A#�invocation_order�declaration_orderc�h��dddtjttff�fd�}t	||��S)z�Given a sequence of parameters in the order as should be considered
    for processing and an iterable of parameters that exist, this returns
    a list in the correct order as they should be processed.
    �itemrTr/c�z��	�j|�}|j|fS#t$rtd�}Y�%wxYw)N�inf)�index�
ValueError�float�is_eager)r[�idxrXs  �r<�sort_keyz,iter_params_for_processing.<locals>.sort_key{sF���	�)�/�/��5�C��=�=� �#�%�%���	���,�C�	�s�#�:�:��key)r2�Tuple�boolr`�sorted)rXrYrcs`  r<�iter_params_for_processingrirs3���&�{�&�q�w�w�t�U�{�';�&��#��2�2rJc���eZdZdZej
�Z	ej
�Z	ej
�Z	ej
�Z		ej
�Z
y)�ParameterSourcea\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)rG�
__module__�__qualname__�__doc__�enum�auto�COMMANDLINE�ENVIRONMENT�DEFAULT�DEFAULT_MAP�PROMPT�rJr<rkrk�sY����$�)�)�+�K�:��$�)�)�+�K�>��d�i�i�k�G�6��$�)�)�+�K�A�
�T�Y�Y�[�F�@rJrkc#��eZdZUdZeZejded<															dJdddejddeje
d	ejejd
eje
dejeje
ejfdeje
d
eje
dedejedejedejedejeje
dejej e
ge
fdejedejeddf"d�Zdej$e
ejffd�ZdKd�Zdejejedejedejeddfd�ZedLdedej2dfd��Zedej$e
ejffd ��Zdefd!�Zd"ej<edefd#�Z d$ej d%ejfdej d%ejffd&�Z!dMd'�Z"ede
fd(��Z#dKd)�Z$d*ejedejefd+�Z%d*ejedefd,�Z&ejN	dLd-e
d.d/dejejfd0��Z(ejN	dNd-e
d.d1dejejRejej gejfffd2��Z(dLd-e
d.edejejfd3�Z(d4e
dd5fd6�Z*dOd7�Z+dPd8e
dd5fd9�Z,de
fd:�Z-de
fd;�Z.dQd<�Z/ejNd=d>d?ejd@ejdefdA��Z0ejNd=dd?ejd@ejdejfdB��Z0d=ejRdCd?ejd@ejdejRejeffdD�Z0dEdd?ejd@ejdejfdF�Z1d-e
dGe2ddfdH�Z3d-e
deje2fdI�Z4y)Rr-a�The context is a special internal object that holds state relevant
    for the script execution at every single level.  It's normally invisible
    to commands unless they opt-in to getting access to it.

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

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

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

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

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

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

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

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

    .. versionchanged:: 2.0
        Added the ``resilient_parsing``, ``help_option_names``, and
        ``token_normalize_func`` parameters.
    r�formatter_classNr5r0�parent�	info_name�obj�auto_envvar_prefix�default_map�terminal_width�max_content_width�resilient_parsing�allow_extra_args�allow_interspersed_args�ignore_unknown_options�help_option_names�token_normalize_func�color�show_defaultr/c�>�||_||_||_i|_g|_g|_|rt
|j�n	t
�|_|�|�|j}||_t|di�|_
|�+|�)|�'|j�|jj|�}||_d|_
|�|�|j}||_|�|�|j}||_|
�|j }
|
|_|�|j"}||_|�|j$}||_|
�|�
|j&}
ndg}
|
|_|�|�|j(}||_|	|_|�D|�R|j,�F|j�:|j,�d|jj/���}n|j/�}|�|j1dd�}||_|�|�|j2}||_|�|�|j4}||_g|_d|_i|_t=�|_y)N�metaz--help�_�-r) ryr5rz�params�args�protected_args�set�
_opt_prefixesr{�getattr�_metar}�get�invoked_subcommandr~rr�r�r�r�r�r�r|�upper�replacer�r��_close_callbacks�_depth�_parameter_sourcer�_exit_stack)�selfr5ryrzr{r|r}r~rr�r�r�r�r�r�r�r�s                 r<�__init__zContext.__init__s���(������"���+-���!#��	�
,.���FL��V�-A�-A�)B�RU�RW����;�6�-��*�*�C����)0����)D��
�
���%��"��"�"�.� �,�,�0�0��;�K�EP���48����!�f�&8�#�2�2�N�0>����$��);� &� 8� 8��3D����#�&�7�7��!1���"�*�&-�&E�&E�#�.E��$�!�)�%,�%C�%C�"�-C��#��$��!�$*�$<�$<�!�%-�J�!�/@����'�F�,>�#)�#>�#>� �
!�	
�!�(9���
�%��"��-�-�9��N�N�.��0�0�1��4�>�>�3G�3G�3I�2J�K�#�"4�!9�!9�!;���)�!3�!;�!;�C��!E��3E����=�V�/��L�L�E�(-��
���F�$6�!�.�.�L�/;���?A������?A���$�;��rJc��|jj|�|j|j|j|j
|jd�S)a*Gather 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
        )r5rzr�r�r�r|)r5�to_info_dictrzr�r�r�r|�r�s r<r�zContext.to_info_dict�sK���|�|�0�0��6���� $� 5� 5�'+�'C�'C�&*�&A�&A�"&�"9�"9�

�	
rJc�F�|xjdz
c_t|�|S�Nr)r�rr�s r<�	__enter__zContext.__enter__�s�����q����T���rJ�exc_type�	exc_value�tbc��|xjdzc_|jdk(r|j�t�y�Nrr)r��closer)r�r�r�r�s    r<�__exit__zContext.__exit__�s,��	
���q����;�;�!���J�J�L��
rJ�cleanupc#��K�|s|xjdz
c_	|5}|��ddd�|s|xjdzc_yy#1swY�"xYw#|s|xjdzc_wwxYw�w)aIThis 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.
        rN)r�)r�r��rvs   r<�scopez
Context.scope�sm����:��K�K�1��K�	!��
����
�����q� ���
�
������q� ���s1�A,�A�A�A�A,�A�A�A)�)A,c��|jS)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�zContext.meta�s��4�z�z�rJc�P�|j|j|j��S)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)rxr~rr�s r<�make_formatterzContext.make_formatters-���#�#��%�%��1G�1G�$�
�	
rJ�context_managerc�8�|jj|�S)a�Register a resource as if it were used in a ``with``
        statement. The resource will be cleaned up when the context is
        popped.

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

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

        .. code-block:: python

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

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

        .. versionadded:: 8.0
        )r��
enter_context)r�r�s  r<�
with_resourcezContext.with_resource%s��6���-�-�o�>�>rJ�f.c�8�|jj|�S)a�Register a function to be called when the context tears down.

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

        :param f: The function to execute on teardown.
        )r��callback)r�r�s  r<�
call_on_closezContext.call_on_closeBs�����(�(��+�+rJc�V�|jj�t�|_y)z�Invoke all close callbacks registered with
        :meth:`call_on_close`, and exit all context managers entered
        with :meth:`with_resource`.
        N)r�r�rr�s r<r�z
Context.closeNs ��
	
����� �$�;��rJc��d}|j�|j}|j��|jjg}t|jjt
�rJ|jjj
|�D]"}|j|j|���$dj|��d|��}|j�S)z�The 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.
        �� )rzry�command_pathrDr5r0�
get_params�extend�get_usage_pieces�join�lstrip)r�r��parent_command_pathrSs    r<r�zContext.command_pathWs������>�>�%����B��;�;�"�#'�;�;�#;�#;�"<���$�+�+�-�-�w�7�!�[�[�0�0�;�;�D�A�M�E�'�.�.�u�/E�/E�d�/K�L�M��H�H�0�1�2�!�B�4�8�B��y�y�{�rJc�T�|}|j�|j}|j��|S)zFinds the outermost context.�ry)r��nodes  r<�	find_rootzContext.find_rootjs+�����k�k�%��;�;�D��k�k�%��rJ�object_typec�n�|}|�1t|j|�r|jS|j}|��1y)z)Finds the closest object of a given type.N)rDr{ry)r�r�r�s   r<�find_objectzContext.find_objectqs:��&*�����$�(�(�K�0��x�x���;�;�D�	��rJc�H�|j|�}|�|�x|_}|S)z�Like :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_objectzContext.ensure_object}s,���
�
�k�
*��
�:�'�M�)�D�H�r��	rJr;�call�te.Literal[True]c��yrNrv�r�r;r�s   r<�lookup_defaultzContext.lookup_default����	rJzte.Literal[False]c��yrNrvr�s   r<r�zContext.lookup_default�r�rJc�~�|j�1|jj|�}|rt|�r|�S|Sy)a*Get 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�zContext.lookup_default�s>�����'��$�$�(�(��.�E������w���L�rJ�message�te.NoReturnc��t||��)z�Aborts the execution of the program with a specific error
        message.

        :param message: the error message to fail with.
        r)r�r�s  r<�failzContext.fail�s����$�'�'rJc��t��)zAborts the script.r
r�s r<�abortz
Context.abort�s	���g�
rJ�codec��t|��)z-Exits the application with a given exit code.r)r�r�s  r<�exitzContext.exit�s���4�j�rJc�8�|jj|�S)zaHelper method to get formatted usage string for the current
        context and command.
        )r5�	get_usager�s r<r�zContext.get_usage�s���|�|�%�%�d�+�+rJc�8�|jj|�S)z^Helper method to get formatted help page for the current
        context and command.
        )r5�get_helpr�s r<r�zContext.get_help�s���|�|�$�$�T�*�*rJc�>�t|�||j|��S)zvCreate a new context of the same type as this context, but
        for a new command.

        :meta private:
        �rzry)rFr;)r�r5s  r<�_make_sub_contextzContext._make_sub_context�s���t�D�z�'�W�\�\�$�G�GrJ�_Context__callback�t.Callable[..., V]r��kwargsc��yrNrv��_Context__selfr�r�r�s    r<�invokezContext.invoke����	rJc��yrNrvr�s    r<r�zContext.invoke�r�rJ)r0r�c�>�t|t�r�|}|j�td��t	j
d|j�}|j
|�}|jD]L}|j|vs�|js�|j||j|��||j<�N|jj|�n|}t|�5|5||i|��cddd�cddd�S#1swYnxYw	ddd�y#1swYyxYw)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.

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

        .. versionchanged:: 8.0
            All ``kwargs`` are tracked in :attr:`params` so they will be
            passed if :meth:`forward` is called at multiple levels.
        Nz?The given command does not have a callback that can be invoked.r�)rDr0r��	TypeErrorr2r3r�r�r;�expose_value�type_cast_value�get_default�updaterW)r�r�r�r��	other_cmdr,rSs       r<r�zContext.invoke�s��2�j�'�*�"�I��!�!�)��U����V�V�$8�)�:L�:L�M�
��*�*�9�5�C�"�)�)�
���:�:�V�+��0B�0B�).�)>�)>��U�.�.�s�3�*�F�5�:�:�&�
�
�J�J���f�%��C�
!�&�
)�	3��
3�!�4�2�6�2�
3�
3�	3�	3�
3�
3��
3�	3�	3�	3�s$�D�"C=�*	D�=D	�D�D�
_Context__cmdc��t|t�std��|jD]}||vs�|j|||<�|j|g|��i|��S)azSimilar 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.
        zCallback is not a command.)rDr0r�r�r�)r�r�r�r�rSs     r<�forwardzContext.forwardsd���%��)��8�9�9��]�]�	5�E��F�"� &�
�
�e� 4��u�
�	5��v�}�}�U�4�T�4�V�4�4rJ�sourcec�"�||j|<y)z�Set the source of a parameter. This indicates the location
        from which the value of the parameter was obtained.

        :param name: The name of the parameter.
        :param source: A member of :class:`~click.core.ParameterSource`.
        N)r�)r�r;r�s   r<�set_parameter_sourcezContext.set_parameter_source&s��(.����t�$rJc�8�|jj|�S)aXGet 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_sourcezContext.get_parameter_source/s�� �%�%�)�)�$�/�/rJ)NNNNNNNFNNNNNNN)r/r-�T)r/N�.)r/r�)r)r5r0r/r-)5rGrlrmrnrrxr2�Type�__annotations__�Optional�str�Any�MutableMapping�intrg�List�Callabler��Dictr�r��
BaseExceptionr
r�r�Iteratorr��propertyr�r��ContextManagerr+r�r�r�r�r�r�r��overloadr��Unionr�r�r�r�r�r�r�r�rkr�rrvrJr<r-r-�s���\�B0=�O�Q�V�V�O�,�<�
)-�%)�!%�.2�@D�*.�-1�"'�-1�48�37�59�CG�"&�)-�#j'��j'��
�
�9�%�j'��:�:�c�?�	j'�
�Z�Z����
�j'��J�J�s�O�
j'��Z�Z�� 0� 0��a�e�e�� <�=�j'��
�
�3��j'��:�:�c�?�j'� �j'��*�*�T�*�j'�"#���D�!1�j'�!"�
�
�4� 0�j'��:�:�a�f�f�S�k�2�j'� �j�j����S�E�3�J�)?�@�j'� �z�z�$��!j'�"�j�j��&�#j'�$
�%j'�X
�a�f�f�S�!�%�%�Z�0�
�*�
	��*�*�Q�V�V�M�2�3�	��:�:�m�,�	�
�J�J�}�%�		�

�	��#!�T�#!�Q�Z�Z�	�-B�#!��#!�J��a�f�f�S�!�%�%�Z�(����6
�
�
�?�Q�-=�-=�a�-@�?�Q�?�:
,�q�z�z�#�q�u�u�*�5�
,�!�*�*�S�!�%�%�Z�:P�
,�'���c����$�
�q�v�v�a�y�
�Q�Z�Z��]�
��������q���Z�Z�48����1��	
���A�E�E�	����
�Z�Z�58����2��	
���A�G�G�A�E�E�1�:�:�b�!�%�%�i�#8�8�9�	:����
�3��d��a�j�j����>O��((�C�(�M�(�����]��,�3�,�+�#�+�H��Z�Z��(���u�u���%�%�	�

�����Z�Z�����u�u���%�%�	�

������33��G�G�;�<�33��u�u�33��%�%�	33�

��������	�33�j5� �5�)*���5�:;�%�%�5�	
���5�*.��.�o�.�$�.�0��0����O�1L�0rJc�b�eZdZUdZeZejeed<dZ	dZ
dZ	d&deje
dejeje
ejfddfd	�Zd
edej"e
ejffd�Zde
fd�Zd
ede
fd
�Zd
ede
fd�Z	d&deje
dej,e
dejedejdef
d�Zd
edej,e
dej,e
fd�Zd
edejfd�Zd
ede
dej,dfd�Zej6				d'dejej8e
deje
deje
dddejddfd��Zej6				d(dejej8e
deje
deje
dedejdejfd��Z					d)dejej8e
deje
deje
ded edejdejfd!�Z	d&d"eje
ejfde
deje
ddfd#�Zdejd$ejdejfd%�Z y)*�BaseCommanda�The base command implements the minimal API contract of commands.
    Most code will never use this as it does not implement a lot of useful
    functionality but it can act as the direct subclass of alternative
    parsing methods that do not depend on the Click parser.

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

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

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

    :param name: the name of the command to use unless a group overrides it.
    :param context_settings: an optional dictionary with defaults that are
                             passed to the context object.
    �
context_classFTNr;�context_settingsr/c�(�||_|�i}||_yrN)r;r)r�r;rs   r<r�zBaseCommand.__init__cs"����	��#�!��?O��rJr,c��d|jiS)aiGather information that could be useful for a tool generating
        user-facing documentation. This traverses the entire structure
        below this command.

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

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

        .. versionadded:: 8.0
        r;�r;�r�r,s  r<r�zBaseCommand.to_info_dictts����	�	�"�"rJc�P�d|jj�d|j�d�S�N�<r��>��	__class__rGr;r�s r<�__repr__zBaseCommand.__repr__��&���4�>�>�*�*�+�1�T�Y�Y�K�q�9�9rJc��td��)NzBase commands cannot get usage��NotImplementedErrorrs  r<r�zBaseCommand.get_usage�s��!�"B�C�CrJc��td��)NzBase commands cannot get helpr$rs  r<r�zBaseCommand.get_help�s��!�"A�B�BrJrzr�ry�extrac��|jj�D]\}}||vs�|||<�|j|f||d�|��}|jd��5|j	||�ddd�|S#1swY|SxYw)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�itemsrr��
parse_args)r�rzr�ryr'rer�r,s        r<�make_contextzBaseCommand.make_context�s���6�/�/�5�5�7�	#�J�C���%��"��c�
�	#�!�d� � ��
�%�f�
�8=�
���Y�Y�u�Y�
%�	'��O�O�C��&�	'��
�	'��
�s�A2�2A<c��td��)z�Given a context and a list of arguments this creates the parser
        and parses the arguments, then modifies the context as necessary.
        This is automatically invoked by :meth:`make_context`.
        z1Base commands do not know how to parse arguments.r$)r�r,r�s   r<r+zBaseCommand.parse_args�s��
"�"U�V�VrJc��td��)z{Given a context, this invokes the command.  The default
        implementation is raising a not implemented error.
        z*Base commands are not invocable by defaultr$rs  r<r�zBaseCommand.invoke�s��"�"N�O�OrJr.r(c����ddlm�g}�j�n�j�t�jt
�r;�jjr%|j��fd�t�|�D���j��n|S)a�Return a list of completions for the incomplete value. Looks
        at the names of chained multi-commands.

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

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

        .. versionadded:: 8.0
        rr'c3�p�K�|]-\}}|�jvr�||j������/y�w���helpN)r��get_short_help_str)�.0r;r5r(r,s   ��r<�	<genexpr>z-BaseCommand.shell_complete.<locals>.<genexpr>�s>������%��g��3�#5�#5�5�#�4�g�.H�.H�.J�K�K��s�36)	�click.shell_completionr(ryrDr5r4rCr�r=)r�r,r.�resultsr(s `  @r<�shell_completezBaseCommand.shell_complete�sm���	:�,.���j�j�$��*�*�C��#�+�+�|�4����9J�9J�����)C�C��)T���	�j�j�$��rJ�	prog_name�complete_var�standalone_moder�r�c��yrNrv�r�r�r:r;r<r's      r<�mainzBaseCommand.main����	rJc��yrNrvr>s      r<r?zBaseCommand.main�r@rJ�windows_expand_argsc�.�|�4tjdd}tjdk(r|rt	|�}nt|�}|�
t
�}|j|||�		|j||fi|��5}|j|�}|s|cddd�S|j�ddd�yy#1swY�
xYw#ttf$r*}	ttj��t�|	�d}	~	wt $r<}	|s�|	j#�tj|	j$�Yd}	~	yd}	~	wt&$r�}	|	j(t(j*k(r�t-j.t,j0t3tj4��t_t-j.t,j0t3tj��t_tjd�n�Yd}	~	yd}	~	wwxYw#t6$r=}	|r tj|	j$�n|	j$cYd}	~	SYd}	~	yd}	~	wt$r?|s�tt9d�tj��tjd�YywxYw)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)�filezAborted!)�sys�argv�osr;r"rOr!�_main_shell_completionr,r�r��EOFError�KeyboardInterruptr#�stderrrr�show�	exit_code�OSError�errno�EPIPEr2r3�TextIOr&�stdoutrr�)
r�r�r:r;r<rBr'r,r�rVs
          r<r?zBaseCommand.main�s���f�<��8�8�A�B�<�D��w�w�$��#6�#�D�)����:�D���,�.�I�	
�#�#�E�9�l�C�.	�
�&�T�&�&�y�$�@�%�@��C����S�)�B�*�!����H�H�J������/�0�
%��#�*�*�%��g�1�$��!�
&�&������������%�%���
��7�7�e�k�k�)�!"������2D�S�Z�Z�2P�!Q�C�J�!"������2D�S�Z�Z�2P�!Q�C�J��H�H�Q�K�� ��	
���	#��������%��{�{�"�&���	�"����:��S�Z�Z�0��H�H�Q�K�		�s��#B<�7B0�	B<�B0�&B<�0B9�5B<�<H�%C0�0H�<2D3�.H�3H�?B<H�;H�H�H�	J�-I	�>J�	AJ�J�ctx_argsc��|�6|jdd�jdd�}d|�d�j�}tjj	|�}|syddlm}||||||�}tj|�y)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)r9)	r�r�rH�environr��shell_completionr9rFr�)r�rTr:r;�
complete_name�instructionr9r�s        r<rIz"BaseCommand._main_shell_completioncsx��$��%�-�-�c�3�7�?�?��S�I�M��}�o�Y�7�=�=�?�L��j�j�n�n�\�2����4�
�D�(�I�|�[�
Q������rJr�c�&�|j|i|��S)zAlias for :meth:`main`.)r?�r�r�r�s   r<�__call__zBaseCommand.__call__�s���t�y�y�$�)�&�)�)rJrN)NNNT)NNN.)NNNTT)!rGrlrmrnr-rr2rrr�r�r�rrrrr�rr�r!r�r�r
r,r+r�r9r�Sequencer?rgrIr^rvrJr<rrBs����0&-�M�1�6�6�'�?�,���"��"��
FJ�O��j�j��o�O��*�*�Q�%5�%5�c�1�5�5�j�%A�B�O�
�	O�"#��#�A�F�F�3����:�,>�#�:�#�:�D�W�D��D�C�G�C��C�'+�	%��:�:�c�?�%��f�f�S�k�%��
�
�7�#�	%�
���%�
�
%�NW�g�W�Q�V�V�C�[�W�Q�V�V�C�[�W�P�'�P�a�e�e�P��'��s��q�v�v�FV�?W��:�Z�Z�-1�%)�(,�.2���j�j����C��)���:�:�c�?���j�j��o�	�
,�����
�
�����Z�Z�-1�%)�(,� #���j�j����C��)���:�:�c�?���j�j��o�	�
�����
�
������-1�%)�(,� $�$(�
o��j�j����C��)�o��:�:�c�?�o��j�j��o�	o�
�o�"�
o����o�
���o�j)-�	��"�"�3����:�.�����j�j��o�	�

��@*�a�e�e�*�q�u�u�*����*rJrc����eZdZdZ											d+dej
edej
ejeejfdej
ejdejfdej
ejdd	ej
ed
ej
edej
edej
ed
ededededdf�fd�
Zde
dejeejff�fd�Zde
defd�Zde
dejdfd�Zde
deddfd�Zde
dejefd�Zde
dejefd�Zde
dej
dfd�Zde
defd�Zde
defd�Zd,dedefd �Zde
deddfd!�Zde
deddfd"�Zde
deddfd#�Zde
deddfd$�Zde
d%ejedejefd&�Z de
dejfd'�Z!de
d(edejd)f�fd*�Z"�xZ#S)-r0a�Commands are the basic building block of command line interfaces in
    Click.  A basic command handles command line parsing and might dispatch
    more parsing to commands nested below it.

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

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

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

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

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

    .. versionchanged:: 2.0
        Added the ``context_settings`` parameter.
    Nr;rr�.r�rTr3�epilog�
short_help�options_metavar�add_help_option�no_args_is_helpr9�
deprecatedr/c
���t�
|�||�||_|xsg|_||_||_||_||_|	|_|
|_	||_
||_yrN)�superr�r�r�r3rarcrbrdrer9rf)r�r;rr�r�r3rarbrcrdrer9rfr s             �r<r�zCommand.__init__�sf���	����/�0�!��
�,2�<�R�����	����.���$���.���.������$��rJr,c���t�|�|�}|j|j|�D�cgc]}|j���c}|j|j
|j|j|j��|Scc}w)N)r�r3rarbr9rf)	rhr�r�r�r3rarbr9rf)r�r,�	info_dictrSr s    �r<r�zCommand.to_info_dict�sv����G�(��-�	����6:�o�o�c�6J�K�U�E�&�&�(�K�����;�;�����;�;����
	�	
����Ls�Bc��|j�}|j||�|j�jd�S)zmFormats the usage line into a string and returns it.

        Calls :meth:`format_usage` internally.
        �
)r��format_usage�getvalue�rstrip�r�r,�	formatters   r<r�zCommand.get_usage�s<��
�&�&�(�	����#�y�)��!�!�#�*�*�4�0�0rJc�P�|j}|j|�}|�g|�|�}|SrN)r��get_help_option)r�r,r��help_options    r<r�zCommand.get_params�s5��
�[�[���*�*�3�/���"�#�2�#�{�#�B��	rJrqc�|�|j|�}|j|jdj|��y)zsWrites 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,rq�piecess    r<rmzCommand.format_usage�s3��
�*�*�3�/�����c�.�.�����0@�ArJc��|jr
|jgng}|j|�D]"}|j|j|���$|S)zhReturns all the pieces that go into the usage line and returns
        it as a list of strings.
        )rcr�r�r�)r�r,r�rSs    r<rvzCommand.collect_usage_pieces�sR��(,�';�';�d�"�"�
#����_�_�S�)�	3�E��I�I�e�,�,�S�1�2�	3��	rJc���t|j�}|jD]8}|j|j�|j|j
��:t
|�S)z&Returns the names for the help option.)r�r�r��difference_update�opts�secondary_optsrO)r�r,�	all_namesrSs    r<�get_help_option_nameszCommand.get_help_option_namessW����-�-�.�	��[�[�	>�E��'�'��
�
�3��'�'��(<�(<�=�	>��I��rJ�Optionc
��|j|�}|r|jsydtdddtddfd�}t	|ddd	|td
���S)zReturns the help option object.Nr,rSrTr�r/c��|rC|js6t|j�|j��|j	�yyy)N�r�)r�r#r�r�r�)r,rSr�s   r<�	show_helpz*Command.get_help_option.<locals>.show_helps1���S�2�2��S�\�\�^�3�9�9�5����
�3�urJTFzShow this message and exit.)�is_flagrar�r�r3)rrdr-rr�r�)r�r,�help_optionsr�s    r<rszCommand.get_help_optionsh���1�1�#�6���4�#7�#7��	�7�	�;�	�s�	�t�	�
�������0�1�

�	
rJc�l�t|�}|j|�D]}|j||��|S)z6Creates the underlying option parser for this command.)rr��
add_to_parser)r�r,�parserrSs    r<�make_parserzCommand.make_parser s9���c�"���_�_�S�)�	-�E������,�	-��
rJc��|j�}|j||�|j�jd�S)zfFormats the help into a string and returns it.

        Calls :meth:`format_help` internally.
        rl)r��format_helprnrorps   r<r�zCommand.get_help's<��
�&�&�(�	�����i�(��!�!�#�*�*�4�0�0rJ�limitc��|jr tj|j�}n%|jrt	|j|�}nd}|j
rt
d�j|��}|j�S)z`Gets short help for the command or makes it by shortening the
        long help string.
        r��(Deprecated) {text}��text)	rb�inspect�cleandocr3r$rfr��format�strip)r�r�r�s   r<r4zCommand.get_short_help_str0sg���?�?��#�#�D�O�O�4�D�
�Y�Y�*�4�9�9�e�<�D��D��?�?��*�+�2�2��2�=�D��z�z�|�rJc��|j||�|j||�|j||�|j||�y)a0Writes 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)rm�format_help_text�format_options�
format_epilogrps   r<r�zCommand.format_help@sD��	
���#�y�)����c�9�-����C��+����3�	�*rJc�d�|j�2tj|j�jd�d}nd}|jrtd�j
|��}|r;|j�|j�5|j|�ddd�yy#1swYyxYw)z3Writes the help text to the formatter if it exists.N�rr�r�r�)
r3r�r��	partitionrfr�r��write_paragraph�indentation�
write_text)r�r,rqr�s    r<r�zCommand.format_help_textQs����9�9� ��#�#�D�I�I�.�8�8��>�q�A�D��D��?�?��*�+�2�2��2�=�D���%�%�'��&�&�(�
+��$�$�T�*�
+�
+��
+�
+�s�
B&�&B/c��g}|j|�D]'}|j|�}|��|j|��)|r5|jt	d��5|j|�ddd�yy#1swYyxYw)z8Writes all the options into the formatter if they exist.N�Options)r��get_help_record�append�sectionr��write_dl)r�r,rqr|rSr�s      r<r�zCommand.format_optionsbs������_�_�S�)�	 �E��&�&�s�+�B��~����B��	 �
��"�"�1�Y�<�0�
)��"�"�4�(�
)�
)��
)�
)�s�A6�6A?c���|jrZtj|j�}|j�|j	�5|j|�ddd�yy#1swYyxYw)z2Writes the epilog into the formatter if it exists.N)rar�r�r�r�r�)r�r,rqras    r<r�zCommand.format_epilognsb���;�;��%�%�d�k�k�2�F��%�%�'��&�&�(�
-��$�$�V�,�
-�
-�	�
-�
-�s�A(�(A1r�c
��|sM|jrA|js5t|j�|j��|j�|j
|�}|j|��\}}}t||j|��D]}|j|||�\}}�|rj|js^|jsR|jtddt|��jdj!t#t$|�����||_|j(j+|j(�|S)Nr�)r�z&Got unexpected extra argument ({args})z'Got unexpected extra arguments ({args})r�)rer�r#r�r�r�r�r+rir��handle_parse_resultr�r�r�lenr�r��maprr�r�r�)r�r,r�r�r|�param_orderrSr�s        r<r+zCommand.parse_argsws����,�,�S�5J�5J������s�y�y�1��H�H�J��!�!�#�&��"(�"3�"3��"3�">���d�K�/��T�_�_�S�=Q�R�	E�E��3�3�C��t�D�K�E�4�	E���,�,�S�5J�5J��H�H��<�=���I���&�c�h�h�s�3��~�6�&�7�
������� � ��!5�!5�6��rJc��|jr=td�j|j��}t	t|d��d��|j�'|j|jfi|j��Sy)zeGiven a context, this invokes the attached callback (if it exists)
        in the right way.
        z7DeprecationWarning: The command {name!r} is deprecated.r�red)�fgT)�errN)	rfr�r�r;r#r r�r�r�)r�r,r�s   r<r�zCommand.invoke�sk���?�?��I���f�$�)�)�f�$�
�
��w�5�)�t�4��=�=�$��3�:�:�d�m�m�:�s�z�z�:�:�%rJr.r(c�������ddlm�g}�r��dj�s�|j|�D]��t	�t
�rC�js7�js,|j�j�tjur�W|j���fd�g�j��j�D����|jt�|�A|���|S)aReturn a list of completions for the incomplete value. Looks
        at the names of options and chained multi-commands.

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

        .. versionadded:: 8.0
        rr'c3�h�K�|])}|j��r�|�j�����+y�wr1)r7r3)r5r;r(r.rSs  ���r<r6z)Command.shell_complete.<locals>.<genexpr>�s3����������z�2�#�4�e�j�j�9�9��s�/2)r7r(�isalnumr�rDr�r9�multiplerr;rkrqr�r|r}rhr9)r�r,r.r8r(rSr s  ` @@�r<r9zCommand.shell_complete�s����	:�,.���j��m�3�3�5�����-�
��"�5�&�1��|�|�!�N�N��4�4�U�Z�Z�@�*�6�6�7������ D�%�*�*� D�u�/C�/C� D���
�$	���u�w�-�c�:�>�?��rJ)NNNNNNz	[OPTIONS]TFFF)�-)$rGrlrmrnr2rrrrrr
rgr�r-rr�r�r�rrmrvrrsrr�r�r	r4r�r�r�r�r+r�r9�
__classcell__�r s@r<r0r0�s����'�XFJ�7;�26� $�"&�&*�+6� $� %�� �%��j�j��o�%��*�*�Q�%5�%5�c�1�5�5�j�%A�B�%��*�*�Q�Z�Z��Q�U�U�
�3�4�	%�
�
�
�1�6�6�+�.�/�%��j�j��o�
%��
�
�3��%��J�J�s�O�%����C��%��%��%��%��%�
�%�@
��
�A�F�F�3����:�,>�
�1�W�1��1��g��!�&�&��*=��B��B�M�B�d�B�	��	�A�F�F�3�K�	����Q�V�V�C�[��
�7�
�q�z�z�(�/C�
�*�w��<��1�G�1��1����S�� +�w�+�=�+�T�+�"+�G�+�
�+�$�+�"
)�'�
)�m�
)��
)�-��-�]�-�t�-��g��Q�V�V�C�[��Q�V�V�C�[��0;�'�;�a�e�e�;�!�'�!�s�!�q�v�v�FV�?W�!�!rJc�t��eZdZdZdZdZ						d!dejede	deje	dejed	e	d
ejejdejfdejd
df�fd�
Zde
d
ejeejff�fd�Zde
d
ej ef�fd�Zde
ded
df�fd�Zd"de	d
ejegeffd�Zde
ded
dfd�Zde
dej ed
ej ef�fd�Zde
d
ejf�fd�Zde
dej ed
ej2ejeejeej effd�Zde
ded
ejefd�Zde
d
ej efd�Zde
ded
ej df�fd �Z�xZS)#r4a�A multi command is the basic implementation of a command that
    dispatches to subcommands.  The most common version is the
    :class:`Group`.

    :param invoke_without_command: this controls how the multi command itself
                                   is invoked.  By default it's only invoked
                                   if a subcommand is provided.
    :param no_args_is_help: this controls what happens if no arguments are
                            provided.  This option is enabled by default if
                            `invoke_without_command` is disabled or disabled
                            if it's enabled.  If enabled this will add
                            ``--help`` as argument if no arguments are
                            passed.
    :param subcommand_metavar: the string that is used in the documentation
                               to indicate the subcommand place.
    :param chain: if this is set to `True` chaining of multiple subcommands
                  is enabled.  This restricts the form of commands in that
                  they cannot have optional arguments but it allows
                  multiple commands to be chained together.
    :param result_callback: The result callback to attach to this multi
        command. This can be set or changed later with the
        :meth:`result_callback` decorator.
    :param attrs: Other command arguments described in :class:`Command`.
    TFNr;�invoke_without_commandre�subcommand_metavarrC�result_callback.�attrsr/c���t�	|�|fi|��|�|}||_||_|�|rd}nd}||_||_||_|j
r:|jD]*}t|t�s�|jr�!td��yy)Nz*COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...zCOMMAND [ARGS]...z<Multi commands in chain mode cannot have optional arguments.)rhr�rer�r�rC�_result_callbackr�rD�Argument�requiredrE)
r�r;r�rer�rCr�r�rSr s
         �r<r�zMultiCommand.__init__�s����	����'��'��"�"8�8�O�.���&<��#��%��%Q�"�%8�"�"4�����
�!0����:�:����
���e�X�.�u�~�~�&�/���
�rJr,c�R��t�|�|�}i}|j|�D]W}|j||�}|��|j	|�}|jd��5|j|�||<ddd��Y|j
||j��|S#1swY��xYw)NFr))�commandsrC)rhr�r6r8r�r�r�rC)r�r,rjr�r;r5�sub_ctxr s       �r<r�zMultiCommand.to_info_dicts�����G�(��-�	����&�&�s�+�		?�D��&�&�s�D�1�G�����+�+�G�4�G����u��-�
?�!(�!5�!5�g�!>����
?�
?�		?�	���(�$�*�*��=���	
?�
?�s�B�B&	c�\��t�|�|�}|j|j�|SrN)rhrvr�r�)r�r,r�r s   �r<rvz!MultiCommand.collect_usage_piecess)���
�W�
)�#�
.��
�	�	�$�)�)�*��	rJrqc�J��t�|�||�|j||�yrN)rhr��format_commands)r�r,rqr s   �r<r�zMultiCommand.format_optionss"���
���s�I�.����S�)�,rJr�c�0���dtdtf��fd�}|S)a�Adds a result callback to the command.  By default if a
        result callback is already registered this will chain them but
        this can be disabled with the `replace` parameter.  The result
        callback is invoked with the return value of the subcommand
        (or the list of return values from all subcommands if chaining
        is enabled) as well as the parameters as they would be passed
        to the main callback.

        Example::

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

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

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

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

        .. versionadded:: 3.0
        r�r/c������j����r	��_�S��fd�}ttjt|���x�_}|S)Nc�4���|g|��i|��}�|g|��i|��SrNrv)�_MultiCommand__valuer�r��innerr��old_callbacks    ��r<�functionzAMultiCommand.result_callback.<locals>.decorator.<locals>.functionBs,���$�W�>�t�>�v�>����0��0��0�0rJ)r�rr2r3r))r�r�r�r�r�r�s`  @��r<�	decoratorz/MultiCommand.result_callback.<locals>.decorator;sN����0�0�L��#�w�()��%���
1�*8����q�(�8K�Q�)O�O�D�!�B��IrJ)r))r�r�r�s`` r<r�zMultiCommand.result_callbacks���:	��	�q�	��rJc���g}|j|�D]7}|j||�}|��|jr�%|j||f��9t	|�r�|j
dz
t
d�|D��z
}g}|D])\}}|j|�}|j||f��+|r5|jtd��5|j|�ddd�yyy#1swYyxYw)zeExtra format methods for multi methods that adds all the commands
        after the options.
        N�c3�8K�|]}t|d����y�w)rN�r�)r5r@s  r<r6z/MultiCommand.format_commands.<locals>.<genexpr>\s����-N�c�c�#�a�&�k�-N�s��Commands)r6r8r9r�r�r��maxr4r�r�r�)	r�r,rqr��
subcommandr@r��rowsr3s	         r<r�zMultiCommand.format_commandsKs�����,�,�S�1�	/�J��"�"�3�
�3�C��{���z�z���O�O�Z��-�.�	/��x�=��O�O�a�'�#�-N�X�-N�*N�N�E��D�#+�
0��
�C��-�-�e�4�����Z��.�/�
0���&�&�q��}�5�-��&�&�t�,�-�-���-�-�s�C$�$C-r�c�T��|sM|jrA|js5t|j�|j��|j�t�|�||�}|jr||_	g|_
|jS|r|dd|ddc|_	|_
|jS)Nr�r)rer�r#r�r�r�rhr+rCr�r�)r�r,r��restr s    �r<r+zMultiCommand.parse_argsgs������,�,�S�5J�5J������s�y�y�1��H�H�J��w�!�#�t�,���:�:�!%�C���C�H��x�x���+/���8�T�!�"�X�(�C�����x�x�rJc�����dtjdtjf��fd�}�jsW�jr1�5t�	����}|�jrgn|�cddd�S�jtd��g�j��j�}g�_	g�_�js}�5�j�|�\}}}|�J�|�_t�	����|j||���}|5||jj|��cddd�cddd�S�5|rdnd�_t�	����g}|rX�j�|�\}}}|�J�|j||�dd�	�}|j|�|jgc}|_	|r�Xg}|D]7}|5|j|jj|��ddd��9||�cddd�S#1swY���xYw#1swYnxYw	ddd���#1swY��xYw#1swY��xYw#1swYyxYw)
Nr�r/c�p���j�(�j�j|fi�j��}|SrN)r�r�r��r�r,r�s ��r<�_process_resultz,MultiCommand.invoke.<locals>._process_resultws5����$�$�0�"��
�
�4�#8�#8�%�N�3�:�:�N���LrJzMissing command.r��*TF)ryr�r�)r2rr�r�rhr�rCr�r�r��resolve_commandr�r,r5r�)
r�r,r�r�r�r?r@r��contextsr s
``       �r<r�zMultiCommand.invokevsx���	�1�5�5�	�Q�U�U�	�
�!�!��*�*��E�����,�B�*����2��D�E�E�
�H�H�Q�)�*�+�0��#�#�/�c�h�h�/��������
�z�z��
L�&*�&:�&:�3��&E�#��#�t���&��)1��&����s�#��*�*�8�T�#�*�F���L�*�7�?�?�+A�+A�'�+J�K�L�L�

L�
L��	'�,0�S�d�C�"��G�N�3��
�H��&*�&:�&:�3��&E�#��#�t���&���*�*����%)�,1�+�������(�%,�\�\�2�"��g�l���B�#�
?���?��I�I�g�o�o�4�4�W�=�>�?�?�
?�#�2�&�3	'�	'�=E�E��,L�L��L�

L�
L�
L��J?�?��/	'�	'�s\�%H�AH*�!H�,	H*�A6I�8	I�+H6�,I�H�H	�H*�*H3�6H?�;I�Ic��t|d�}|}|j||�}|�/|j�#|j|�}|j||�}|�`|jsTt	|�dr|j||j�|jtd�j|���|r|nd||ddfS)NrzNo such command {name!r}.rr)
r%r8r�r�rr+r�r�r�r�)r�r,r�r?�original_cmd_namer@s      r<r�zMultiCommand.resolve_command�s����D��G�$��$�����s�H�-���;�3�3�3�?��/�/��9�H��"�"�3��1�C��;�s�4�4���"�1�%�����S�X�X�.��H�H�Q�2�3�:�:�@Q�:�R�S��x�D�#�t�A�B�x�7�7rJr?c��t�)z{Given a context and a command name, this returns a
        :class:`Command` object if it exists or returns `None`.
        r$�r�r,r?s   r<r8zMultiCommand.get_command�s
��"�!rJc��gS)zTReturns a list of subcommand names in the order they should
        appear.
        rvrs  r<r6zMultiCommand.list_commands�s	���	rJr.r(c	����ddlm}t||�D��cgc]\}}|||j�����}}}|j	t
�|�||��|Scc}}w)a0Return 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
        rr'r2)r7r(r=r4r�rhr9)r�r,r.r(r;r5r8r s       �r<r9zMultiCommand.shell_complete�sf���	:�"<�C��!L�
���g�
�4�g�&@�&@�&B�C�
��
�	���u�w�-�c�:�>�?����
s�"A)NFNNFN�F) rGrlrmrnr�r�r2rrrgrrr�r-rr�r
rvrr�r)r�r�r+r�rfr0r�r8r6r9r�r�s@r<r4r4�sE����2��#��!%�',�,0�.2��>B�$��j�j��o�$�!%�$����D�)�	$�
�J�J�s�O�$��
$����A�J�J�s�A�E�E�z�$:�;�$����$�
�$�L���A�F�F�3����:�,>��$���A�F�F�3�K��
-�'�-�m�-��-�+�t�+��
�
�A�3��6�8J�+�Z-�7�-�}�-��-�8
�g�
�Q�V�V�C�[�
�Q�V�V�C�[�
�B'�'�B'�a�e�e�B'�H8��8�"#�&�&��+�8�	
������C��!�*�*�W�"5�q�v�v�c�{�B�	C�8�6"�w�"�#�"�!�*�*�W�:M�"����Q�V�V�C�[���'��s��q�v�v�FV�?W��rJc
���eZdZUdZdZejejee	d<dZ
ejejejdejefe	d<		ddeje
dejejeje
efejefdej ddf�fd	�
Zdd
edeje
ddfd�Zej&dej(d
ej fdefd��Zej&dej dej dej(ej(d
ej fgeffd��Zdej dej dejej(ej(d
ej fgefeffd�Zej&dej(d
ej fddfd��Zej&dej dej dej(ej(d
ej fgdffd��Zdej dej dejej(ej(d
ej fgdfdffd�Zdede
dejefd�Zdedej2e
fd�Z�xZS)�GroupaMA group allows a command to have subcommands attached. This is
    the most common way to implement nesting in Click.

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

    .. versionchanged:: 8.0
        The ``commands`` argument can be a list of command objects.
    N�
command_class�group_classr;r�r�r/c����t�|�|fi|��|�
i}||_yt|tj�r'|D�cic]}|j
��|j
|��}}||_ycc}wrN)rhr�rDrr_r;r�)r�r;r�r��cr s     �r<r�zGroup.__init__sp���	����'��'����H�
9A��
�	��#�,�,�
/�+3�J�a�q�v�v�7I�����	�J�H�J�9A��
��Ks�A'�A'r@c�z�|xs|j}|�td��t|||d��||j|<y)z�Registers another :class:`Command` with this group.  If the name
        is not provided, the name of the command is used.
        NzCommand has no name.T)rA)r;r�rIr�)r�r@r;s   r<�add_commandzGroup.add_command+s?����s�x�x���<��2�3�3��D�$��d�;�!��
�
�d�rJ�_Group__func.c��yrNrv�r�r�s  r<r5z
Group.command5���rJr�r�c��yrNrvr]s   r<r5z
Group.command9r�rJc�H�����ddlm�d}�r+t�d�rt��dk(r�rJd���\}d��jr �jd���j�d<dtjd	tjfd
tf����fd�}|�||�S|S)aA 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)r5Nrz7Use 'command(**kwargs)(callable)' to provide arguments.rv�clsr�.r/c�F����i���|�}�j|�|SrN�r�)r�r@r�r5r�r�s  ����r<r�z Group.command.<locals>.decorator^s,���3�7�D�3�F�3�A�6�C����S�!��JrJ)
�
decoratorsr5r�r�r�r�r2rrr0)r�r�r��funcr�r5s```  @r<r5z
Group.command?s����"	(�37���H�T�!�W�%��D�	�Q��v�
I�H�
I�-��G�T��D����&�*�*�U�"3�";� �.�.�F�5�M�	����C����J�/�	�G�	�	�
���T�?�"��rJc��yrNrvr�s  r<�groupzGroup.grouphr�rJc��yrNrvr]s   r<r�zGroup.grouplr�rJc������ddlm�d}�r+t�d�rt��dk(r�rJd���\}d��j�A�jd��0�jturt
���d<n�j�d<dtjd	tjfd
df����fd�}|�||�S|S)
aA 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)r�Nrz5Use 'group(**kwargs)(callable)' to provide arguments.rvr�r�.r/r�c�F����i���|�}�j|�|SrNr�)r�r@r�r�r�r�s  ����r<r�zGroup.group.<locals>.decorator�s,���/���/��/��2�C����S�!��JrJ)
r�r�r�r�r�r�rFr2rr)r�r�r�r�r�r�s```  @r<r�zGroup.grouprs����"	&�37���H�T�!�W�%��D�	�Q��v�
G�F�
G�-��G�T��D����'�F�J�J�u�,=�,E����4�'� $�T�
��u�
� $� 0� 0��u�
�	����C����J�/�	�G�	�	�
���T�?�"��rJr,r?c�8�|jj|�SrN)r�r�r�s   r<r8zGroup.get_command�s���}�}� � ��*�*rJc�,�t|j�SrN)rhr�rs  r<r6zGroup.list_commands�s���d�m�m�$�$rJ�NNrN)rGrlrmrnr�r2rrr0rr�rrFrrr_rr�r�rrr5r�r-r8r
r6r�r�s@r<r�r��s���
�(26�M�1�:�:�a�f�f�W�o�.�5�GK�K����A�G�G�A�F�F�7�O�Q�V�V�D�\�$A�B�C�J�
!%�
�A��j�j��o�A��*�*�
�G�G�A�$�$�S�'�\�2�A�J�J�w�4G�G�H�
�A����
A�
�A�$"�w�"�a�j�j��o�"��"��Z�Z��a�j�j��a�e�e��4�������Z�Z���U�U��&'�e�e��	
���Q�Z�Z��Q�U�U�
�+�,�g�5�	6����
'��U�U�'�&'�e�e�'�	
������Q�Z�Z��Q�U�U�
�3�4�g�=�>��G�	H�'�R�Z�Z��A�J�J�s�A�E�E�z�2��w�����Z�Z���U�U��&'�e�e��	
���Q�Z�Z��Q�U�U�
�+�,�g�5�	6����
*��U�U�*�&'�e�e�*�	
������Q�Z�Z��Q�U�U�
�3�4�g�=�>��G�	H�*�X+�w�+�#�+�!�*�*�W�:M�+�%��%�Q�V�V�C�[�%rJr�c	���eZdZdZ		ddej
edej
ejedejddf�fd�
Z
deddfd	�Zd
ededej
e
fd�Zd
edejefd
�Z�xZS)�CommandCollectionakA command collection is a multi command that merges multiple multi
    commands together into one.  This is a straightforward implementation
    that accepts a list of different multi commands as sources and
    provides all the commands for each of them.

    See :class:`MultiCommand` and :class:`Command` for the description of
    ``name`` and ``attrs``.
    Nr;�sourcesr�r/c�<��t�|�|fi|��|xsg|_yrN)rhr�r)r�r;rr�r s    �r<r�zCommandCollection.__init__�s"���	����'��'�-4�]���rJ�	multi_cmdc�:�|jj|�y)z1Adds a new multi command to the chain dispatcher.N)rr�)r�rs  r<�
add_sourcezCommandCollection.add_source�s�������I�&rJr,r?c��|jD]3}|j||�}|��|jr
t|||�|cSyrN)rr8rCrI)r�r,r?r�r�s     r<r8zCommandCollection.get_command�sI���l�l�	�F��#�#�C��2�B��~��:�:�'��h��;��	�	�rJc��t�}|jD]"}|j|j|���$t	|�SrN)r�rr�r6rh)r�r,r�r�s    r<r6zCommandCollection.list_commands�s?������l�l�	1�F��I�I�f�*�*�3�/�0�	1��b�z�rJr)rGrlrmrnr2rrr
r4rr�rr-r0r8r6r�r�s@r<rr�s�����!%�48�;��j�j��o�;����A�F�F�<�0�1�;����	;�

�;�'�L�'�T�'�
�w�
�#�
�!�*�*�W�:M�
����Q�V�V�C�[�rJrr�c�D�t|t�rt�t|�S)ztCheck if the value is iterable but not a string. Raises a type
    error, or return an iterator over the value.
    )rDrr�rQ)r�s r<�_check_iterr�s���%�������;�rJc��eZdZdZdZ												d0dejejedejeje
jejfde
dejejejejgejffdejejedejgejfd	ejed
e
dejede
d
e
dejejeejefdejejedegejej"dej"effddfd�Zdej&eejffd�Zdefd�Zdejede
dej,ejeej"eej"effd�Zedefd��Zdefd�Zej6	d1dedddejejfd��Zej6	d2dede
dejejejejgejfffd��Z	d1dede
dejejejejgejfffd�Zdededdfd �Zded!ej>eejfdej,eje ffd"�Z!ded#ejdejfd$�Z"d#ejde
fd%�Z#ded#ejdejfd&�Z$dedejefd'�Z%dedejejfd(�Z&ded!ej>eejfd)ej"edej,ejej"effd*�Z'dedejej,eeffd+�Z(dedej"efd,�Z)dedefd-�Z*ded.edej"dfd/�Z+y)3rTa�A parameter to a command comes in two versions: they are either
    :class:`Option`\s or :class:`Argument`\s.  Other subclasses are currently
    not supported by design as some of the internals for parsing are
    intentionally not finalized.

    Some settings are supported by both options and arguments.

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

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

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

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

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

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

    .. versionchanged:: 2.0
        Changed signature for parameter callback to also be passed the
        parameter. The old callback format will still work, but it will
        raise a warning to give you a chance to migrate the code easier.
    �	parameterN�param_declsrFr��defaultr��nargsr��metavarr�ra�envvarr9r(r/c
	��||||j|xsd|	�\|_|_|_t	j
||�|_|�/|jjr|jj}nd}||_	||_
||_||_|	|_
||_|
|_||_||_||_	|jjrL||jjk7r3t'd|jj�d|j�d|�d���t)|�s|nd}
|
�Z|r	t+t-|
�d�}
|dk7r<|
�9	t-|
�|dkDr't1|
�|k7r|rd
nd}t'd|�d
|�d���yyyyy#t.$r
t'd�d�wxYw#t.$r|rd}nd	}t'|�d�wxYw)Nrvrz'nargs' must be z (or None) for type z
, but it was rVz1'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.zitem length�lengthz
'default' z must match nargs=)�_parse_declsr;r|r}r�convert_typerF�is_composite�arityr�r�rr�r�rrarr�_custom_shell_completer_r��nextrr�r�)r�rrFr�rr�rr�rr�rarr9�
check_defaultr��subjects                r<r�zParameter.__init__(s��(	
���48�4E�4E���2�|�5
�1��	�4�9�d�1�&+�%7�%7��g�%F��	��=��y�y�%�%��	�	������ ��
� ��
���
� ��
�(������ ��
�������&4��#���y�y�%�%�%�4�9�9�?�?�*B� �&�t�y�y���&7�8�!�Y�Y�M��u�g�Q�@���,4�G�+<�G�$�M��(��$�(,�[��-G��(N�
��A�:�-�";�<�#�M�2��q�y�S��%7�5�%@�3;�-���(�(��	�1C�E�7�!�L���&A�y�#<�:�)��
%�$�(�O��#�$�$��%�	<�#�!:�$�
'T�G�(��1�t�;�	<�s�9F�F*�F'�*Gc��|j|j|j|j|jj�|j|j|j|j|jd�
S)z�Gather information that could be useful for a tool generating
        user-facing documentation.

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

        .. versionadded:: 8.0
        )
r;�param_type_namer|r}rFr�rr�rr)r;rr|r}rFr�r�rr�rrr�s r<r�zParameter.to_info_dict�sa���I�I�#�3�3��I�I�"�1�1��I�I�*�*�,��
�
��Z�Z��
�
��|�|��k�k�
�	
rJc�P�d|jj�d|j�d�Srrr�s r<r!zParameter.__repr__�r"rJ�declsc��t��rNr$)r�r r�s   r<rzParameter._parse_decls�s
��"�#�#rJc��|jS)z�Returns the human readable name of this parameter.  This is the
        same as the name for options, but the metavar for arguments.
        rr�s r<�human_readable_namezParameter.human_readable_name�s��
�y�y�rJc���|j�|jS|jj|�}|�$|jjj	�}|j
dk7r|dz
}|S)Nr�...)rrF�get_metavarr;r�r)r�rs  r<�make_metavarzParameter.make_metavar�s_���<�<�#��<�<���)�)�'�'��-���?��i�i�n�n�*�*�,�G��:�:��?��u��G��rJr,r�r�c��yrNrv�r�r,r�s   r<r�zParameter.get_default�r�rJc��yrNrvr)s   r<r�zParameter.get_default�r�rJc��|j|jd��}|�|j}|rt|�r|�}|S)a�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;rr�)r�r,r�r�s    r<r�zParameter.get_default�s@��.�"�"�4�9�9�5�"�9���=��L�L�E��H�U�O��G�E��rJr�c��t��rNr$�r�r�r,s   r<r�zParameter.add_to_parser�s��!�#�#rJr|c�F�|j|j�}tj}|�!|j	|�}tj
}|�+|j
|j�}tj}|�!|j|�}tj}||fSrN)
r�r;rkrq�value_from_envvarrrr�rtr�rs)r�r,r|r�r�s     r<�
consume_valuezParameter.consume_value�s���������#�� �,�,���=��*�*�3�/�E�$�0�0�F��=��&�&�t�y�y�1�E�$�0�0�F��=��$�$�S�)�E�$�,�,�F��f�}�rJr�c�r�����|��js�jdk(rdSdSdtjdtjtjf��fd���jdk(s�j
jr(dtjdtjf��fd��n`�jdk(r)dtjdtjf���fd	��n(dtjdtjf���fd
���jrt�fd��|�D��S�|�S)zuConvert and validate a value against the option's
        :attr:`type`, :attr:`multiple`, and :attr:`nargs`.
        N���rvr�r/c�f��	t|�S#t$rttd�����d�wxYw)NzValue must be an iterable.�r,rS)rr�rr�r�s ��r<�
check_iterz-Parameter.type_cast_value.<locals>.check_iter�sA���
�"�5�)�)���
�#��2�3��D����	
�s�
�"0rc�,���j|����S)N)rSr,�rFr�s ��r<�convertz*Parameter.type_cast_value.<locals>.convert	s����y�y��d��y�<�<rJc�:��t��fd��|�D��S)Nc3�D�K�|]}�j|������y�wrNr8�r5�xr,r�s  ��r<r6z=Parameter.type_cast_value.<locals>.convert.<locals>.<genexpr>	s�����P��T�Y�Y�q�$��4�P��� )�tuple�r�r6r,r�s ���r<r9z*Parameter.type_cast_value.<locals>.convert	s����P�j��>O�P�P�PrJc	���t�|��}t|��jk7rFtt	ddt|��j�jt|��������t��fd�|D��S)Nz%Takes {nargs} values but 1 was given.z*Takes {nargs} values but {len} were given.)rr�r5c3�D�K�|]}�j|������y�wrNr8r<s  ��r<r6z=Parameter.type_cast_value.<locals>.convert.<locals>.<genexpr>#	s�����D��T�Y�Y�q�$��4�D�r>)r?r�rrrr�r@s ���r<r9z*Parameter.type_cast_value.<locals>.convert	su����j��/�0���u�:����+�&� �C�H���J��!�&�t�z�z�s�5�z�&�B��"����D�e�D�D�DrJc3�.�K�|]}�|����y�wrNrv)r5r=r9s  �r<r6z,Parameter.type_cast_value.<locals>.<genexpr>&	s�����?�����?�s�)r�rr2rrrFrr?)r�r,r�r6r9s`` @@r<r�zParameter.type_cast_value�s�����=����$�*�*��*:�2�D��D�		�a�e�e�		��
�
�1�5�5�(9�		��:�:��?�d�i�i�4�4�
=�q�u�u�
=����
=��Z�Z�2�
�
Q�q�u�u�
Q����
Q�
Q�

E�q�u�u�
E����
E� �=�=��?�Z��->�?�?�?��u�~�rJc�L�|�y|jdk7s|jr|dk(ryy)NTrrvF)rr�)r�r�s  r<�value_is_missingzParameter.value_is_missing*	s'���=���J�J�!�O�t�}�}�%�2�+��rJc��|j||�}|jr|j|�r
t||���|j�|j	|||�}|S)Nr5)r�r�rErr�)r�r,r�s   r<�
process_valuezParameter.process_value3	sV���$�$�S�%�0���=�=�T�2�2�5�9�"�s�$�7�7��=�=�$��M�M�#�t�U�3�E��rJc��|j�yt|jt�r.tjj|j�}|r|Sy|jD]'}tjj|�}|s�%|cSyrN)rrDrrHrXr�)r�r,r�rs    r<�resolve_envvar_valuezParameter.resolve_envvar_value>	st���;�;����d�k�k�3�'���������,�B���	��
�+�+�
���Z�Z�^�^�F�+����I�	
�rJc��|j|�}|�*|jdk7r|jj|�}|Sr�)rIrrF�split_envvar_value)r�r,r�s   r<r0zParameter.value_from_envvarP	s:�� $� 9� 9�#� >��
�>�d�j�j�A�o����-�-�b�1�B��	rJr�c�\�t||��5|j||�\}}|j|j|�	|j	||�}ddd�|jr|j|j<|fS#t
$r|js�d}Y�KwxYw#1swY�PxYw)N)rS)	rWr1r�r;rG�	Exceptionr�r�r�)r�r,r|r�r�r�s      r<r�zParameter.handle_parse_resultX	s���"�#�T�
2�
	� �.�.�s�D�9�M�E�6��$�$�T�Y�Y��7�
��*�*�3��6��
	����$)�C�J�J�t�y�y�!��d�{����
��,�,����	
��
	�
	�s)�2B"�B�B�B"�B�B"�"B+c��yrNrvrs  r<r�zParameter.get_help_recordl	s��rJc��gSrNrvrs  r<r�zParameter.get_usage_pieceso	s���	rJc�h�|jxs
|jg}djd�|D��S)z{Get a stringified version of the param for use in error messages to
        indicate which param caused the error.
        � / c3�(K�|]
}d|�d����y�w)�'Nrv)r5r=s  r<r6z+Parameter.get_error_hint.<locals>.<genexpr>w	s����6�q�A�a�S��(�6�s�)r|r#r�)r�r,�	hint_lists   r<�get_error_hintzParameter.get_error_hintr	s0���I�I�;�$�":�":�!;�	��z�z�6�I�6�6�6rJr.c�2�|j�j|j|||�}|r.t|dt�rddlm}|D�cgc]
}||���}}tjt
jd|�S|jj|||�Scc}w)a�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
        rr'r()
rrDrr7r(r2r3r
rFr9)r�r,r.r8r(r�s      r<r9zParameter.shell_completey	s����&�&�2��1�1�#�t�Z�H�G��:�g�a�j�#�6�A�6=�>��>�!�,�>��>��6�6�!�&�&�!1�2�G�<�<��y�y�'�'��T�:�>�>��	?s�B)NNFNNNFNTFNNrr),rGrlrmrnrr2rr_rrr�	ParamTyperrgrr-r	r
r�rr�r!rfrrr#r'rr�rr��Mappingrkr1r�rErGrIr0r�r�r�rUr9rvrJr<rTrT�s��G�R"�O�48�<@��EI�QU�!%��#'�!��<@�
�%V��Z�Z��
�
�3��0�V��j�j�������!�%�%�!7�8�9�V��	V�
���A�G�G�A�E�E�1�:�:�b�!�%�%�i�+@�$@�A�B�V��*�*�Q�Z�Z��+�q�u�u�(E�q�u�u�(L�M�N�
V��z�z�#��V��V����C��V��V��V��
�
�1�7�7�3��
�
�3��#7�8�9�V��
�
�
�J�J��+�s�+�������/�0�!�&�&��+�=�>�@�
�
�V�&
�'V�p
�a�f�f�S�!�%�%�Z�0�
�,:�#�:�$��Z�Z��_�$�48�$�	
������C��!�&�&��+�q�v�v�c�{�:�	;�$�
��S�����c���Z�Z�7;����"4��	
���A�E�E�	����
�Z�Z�),����"&��	
���A�G�G�A�E�E�1�:�:�b�!�%�%�i�#8�8�9�	:����*.����"&��	
���A�G�G�A�E�E�1�:�:�b�!�%�%�i�#8�8�9�	:��B$�L�$�w�$�4�$����"#�)�)�C����J�"7��	
�������'�	(��(1�7�1�1�5�5�1�Q�U�U�1�f�a�e�e����	��	����	�1�5�5�	����A�J�J�s�O��$�W�����A�E�E�1B�����"#�)�)�C����J�"7��?@�v�v�c�{��	
���������s��#�	$��(
�7�
�q�z�z�!�'�'�#�s�(�:K�/L�
��G�����s���7�'�7�c�7�?�'�?�s�?�q�v�v�FV�?W�?rJc%����eZdZdZdZ																d*dejejedeje
edfdeje
efdeje
efde
d	e
d
eje
dejejde
d
e
de
dejejejejfdejede
de
de
dejddf$�fd�
Zdejeejff�fd�Zdejede
dej"ejeej$eej$effd�Zdededdfd�Zdedejej"eeffd�Zej0	d+dedd dejejfd!��Zej0	d,dede
dejejejej4gejfffd"��Z	d+dede
dejejejej4gejfff�fd#�
Zdedejfd$�Zdedejef�fd%�Zdedejejfd&�Zded'ej<ed(fdej"ejeff�fd)�Z �xZ!S)-r�a�Options are usually optional values on the command line and
    have some extra features that arguments don't have.

    All other parameters are passed onwards to the parameter constructor.

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

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

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

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

    .. versionchanged:: 8.0.1
        ``type`` is detected from ``flag_value`` if given.
    �optionNrr�r�confirmation_prompt�prompt_required�
hide_inputr��
flag_valuer��count�allow_from_autoenvrFr3r9�show_choices�show_envvarr�r/c���|
rtj|
�}
d|v}t�|�|f||	d�|��|durB|j�td��|jj
dd�j�}n	|durd}n|}||_||_	||_
||_||_|jduxr
|j|_
|�*|�d}n>|jrd}n/t|j�}n|dur|js	|du|_
||r|r|j s|	rd|_nd|_|�
|j"}||r|�t%j&d|�|_||_|xr$t-|j(t$j.�|_||_|
|_|
r&|�t%j6d	�
�|_|rd	|_||_|
|_||_||_||_ 	|jBdk(rtd��|jr#|j*r|j0std
��|j0s|jrtd��|j0r#|jr|j�td��|j4r/|jDrtd��|j*rtd��yy)Nr)rFr�Tz&'name' is required with 'prompt=True'.r�r�Frvr)�minr3z&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�rhr�r;r�r��
capitalizerr[r\r]r9rrgr}r�rrrrFr�rD�
BoolParamType�is_bool_flagr^r_�IntRanger`r3r�rarbrr�)r�rr�rr[r\r]r�r^r�r_r`rFr3r9rarbr��default_is_missing�prompt_textr s                    �r<r�zOption.__init__�	s����(��#�#�D�)�D�&�e�3��
����L�4�(�L�e�L��T�>��y�y� �� H�I�I�+/�9�9�+<�+<�S�#�+F�+Q�+Q�+S�K�
�u�_��K� �K�!���#6�� �.���$������"&���D�!8�!U��AU�AU�=U����?��%����'�'����t�2�2�3��
��
�d�&<�&<�&0�t�%;�D�"���)�$�-�-��!���$�����!�\�\�)�J���t�|��*�*�4��<�D�I�$���")�"X�j����E�DW�DW�.X���!+�����
���|�!�N�N�q�1��	�!� ���"4�����	�(���(���&�����z�z�R��� H�I�I��{�{�t�|�|�D�4E�4E�� M�N�N��$�$��)<�)<�� S�T�T�� � �T�_�_����9P��O����z�z��=�=�#�$K�L�L��<�<�#�$J�K�K� �	rJc����t�|��}|j|j|j|j
|j|j|j��|S)N)r3rr�r^r_r9)	rhr�r�r3rr�r^r_r9)r�rjr s  �r<r�zOption.to_info_dictF
sU����G�(�*�	��������;�;��L�L�����*�*��;�;�
	�	
��rJr r�c�
�g}g}d}g}|D]�}|j�r|�td|�d���|}�'|dddk(rdnd}||vr�|j|d�\}	}
|	j�}	|	r+|j	t|	��|j	|	�|
j
�}
|
r|j	|
j
��|	|
k(s��td|�d���|j	t|��|j	|���|�M|rK|jd��	�|d
djdd�j�}|j�sd}|�|sd||fStd
��|s|std|�d|�d���|||fS)NzName 'z' defined twicer�/�;zBoolean option z) cannot use the same flag for true/false.c� �t|d�S)Nrr�)r=s r<�<lambda>z%Option._parse_decls.<locals>.<lambda>t
s��s�1�Q�4�y�j�rJrdrr�r�z#Could not determine name for optionz*No options defined but a name was passed (zH). Did you mean to declare an argument instead? Did you mean to pass '--z'?)�isidentifierr��splitror�rr�r_�sortr��lower)r�r r�r|r}r;�possible_names�decl�
split_char�first�seconds           r<rzOption._parse_declsR
s������������	&�D�� � �"��#�#�f�T�F�/�$B�C�C���$(��!�H��O�S��
���%�$(�J�J�z�1�$=�M�E�6�!�L�L�N�E��&�-�-�i��.>�?����E�*�#�]�]�_�F��&�-�-�f�m�m�o�>����(�-�d�X�69�9���
#�)�)�)�D�/�:��K�K��%�/	&�2�<�N����$8��9�!�!�$�Q�'�/�/��S�9�?�?�A�D��$�$�&����<���T�>�1�1��A�B�B��N��<�T�F�C(�(,�v�R�1��
��T�>�)�)rJr�r,c��|jrd}n|jrd}nd}|jr�|�d�}|jra|jrU|j||j|j|d��|j||j|j|d��y|j||j|j||j��y|j||j|j||j��y)	Nr�r_�store�_constT)r{r|�dest�action�constF)r{r|r}r~r)
r�r_r�rgr}�
add_optionr|r;r^r)r�r�r,r~s    r<r�zOption.add_to_parser�
s����=�=��F�
�Z�Z��F��F��<�<��x�v�&�F�� � �T�%8�%8��!�!��4�9�9�4�9�9�V�SW�"���!�!���,�,����!��"���!�!��������!��/�/�"��
�����Y�Y��Y�Y���j�j�
�
rJc�����jryd�dtjtdtf��fd�}|�j�g}�j
r!|j
|�j
���jxsd}g}�jr��j}|�M�jrA|j�5�j�)|j�d�jj���}|�Tt|t�r|ndjd�|D��}|j
t!d	�j#|�
��|j$}d|_	�j'|d��}	||_d}
d}�j(�,t�j(t�rdx}}
n%�j(}
n|j(�|j(}
|s|
�r|	��|rd
�j(�d�}n�t|	t*t,f�rdjd�|	D��}n�t/j0|	�rt!d�}nt�j2r@�j
r4t5�j6r�jn�j
d�d}n(�j2r�j
s|	sd}nt|	�}|r*|j
t!d�j#|���t�j8t:j<�rh�j>r/�j8j@dk(r�j8jB�-�j8jE�}
|
r|j
|
��jFr|j
t!d��|r!dj|�}|r|�d|�d�nd|�d�}�rdndj|�|fS#||_wxYw)NFr|r/c���t|�\}}|rd��js"�js|d�j���z
}|S)NTr�)rr�r_r')r|r��any_slashes�any_prefix_is_slashr�s   ��r<�_write_optsz+Option.get_help_record.<locals>._write_opts�
sI���+�4�0�O�B���&*�#��<�<��
�
���$�+�+�-�.�/�/���IrJr�r�z, c3�2K�|]}t|����y�wrN�r�r5�ds  r<r6z)Option.get_help_record.<locals>.<genexpr>�
s����":�a�3�q�6�":���zenv var: {var})�varTr,�(�)c3�2K�|]}t|����y�wrNr�r�s  r<r6z)Option.get_help_record.<locals>.<genexpr>�
s����*I�a�3�q�6�*I�r�z	(dynamic)rrzdefault: {default})rr�z; z  [�]�[rQ)$r9r2r_rr|r}r�r3rbrr`r|r;r�rDr�r�r�r�r�r�rOr?r��
isfunctionrgrrrFr�_NumberRangeBaser_rdr��_describe_ranger�)r�r,r�r�r3r'r�var_str�	resilient�
default_valuer��show_default_is_str�default_string�	range_str�	extra_strr�s`              @r<r�zOption.get_help_record�
sP����;�;��#��	�a�j�j��o�	�#�	��$�)�)�$�
%������I�I�k�$�"5�"5�6�7��y�y��B��������[�[�F��~��+�+��.�.�:��	�	�-� #� 6� 6�7�q������9J�8K�L�F��!�"�&�#�.�����":�6�":�:��
���Q�/�0�7�7�G�7�D�E�
�)�)�	� $���	.� �,�,�S�u�,�=�M�$-�C�!���#�����(��$�+�+�S�1�59�9�#�l�#�0�0��
�
�
�
)��+�+�L��<�]�5N�"�#$�T�%6�%6�$7�q�!9���M�D�%�=�9�!%���*I�=�*I�!I���#�#�M�2�!"�;����"�"�t�':�':�"+�"&�,�,�T�Y�Y�D�4G�4G��K�"��"���"�"�4�+>�+>�}�!#��!$�]�!3������Q�3�4�;�;�N�;�S�T�
�t�y�y�%�"8�"8�9��Z�Z�D�I�I�M�M�Q�$6�4�9�9�=�=�;P��	�	�1�1�3�I�����Y�'��=�=��L�L��:��'���	�	�%�(�I�/3�d�V�3�y�k��+�1�Y�K�q�9I�D�+���<�<�R�@�$�F�F��g%.�C�!�s�N>�>	Or�r�c��yrNrvr)s   r<r�zOption.get_defaultr�rJc��yrNrvr)s   r<r�zOption.get_default r�rJc�&��|jrt|jsh|jjD]N}|j|jk(s�|j
s�*t
jt|�jcSyt�|�-||��S)Nr,)r�rgr5r�r;rr2r3r�r^rhr�)r�r,r�rSr s    �r<r�zOption.get_default&st����<�<�� 1� 1����+�+�
<���:�:����*�u�}�}��6�6�&�%�0�;�;�;�
<���w�"�3�T�"�2�2rJc
�����j�J��j��}�jrt�j|�St�j|�j�j
�j�j��fd���S)z�This is an alternative flow that can be activated in the full
        value processing if a value does not exist.  It will prompt the
        user until a valid value exists and then returns the processed
        value as result.
        c�(���j�|�SrN)rG)r=r,r�s ��r<rpz)Option.prompt_for_value.<locals>.<lambda>Ms����!3�!3�C��!;�rJ)rrFr]rar[�
value_proc)rr�rgrrFr]rar[)r�r,rs`` r<�prompt_for_valuezOption.prompt_for_value6s}����{�{�&�&�&��"�"�3�'������4�;�;��0�0���K�K���������*�*� $� 8� 8�;�
�	
rJc���t�|�|�}|�|S|jrd|j�X|j�L|j�d|jj���}tjj|�}|r|Sy)Nr�)	rhrIr`r|r;r�rHrXr�)r�r,r�rr s    �r<rIzOption.resolve_envvar_valuePs}���
�W�
)�#�
.��
�>��I�
�#�#��&�&�2��	�	�%��.�.�/�q������1B�0C�D�F�������'�B���	�rJc��|j|�}|�y|jdk7t|j�z}|dkDrL|jj|�}|jr%|jdk7rt
||j�}|Sr�)rIrrgr�rFrKrR)r�r,r��value_depths    r<r0zOption.value_from_envvarcsv�� $� 9� 9�#� >��
�:���z�z�Q��$�t�}�}�*=�=����?����-�-�b�1�B��}�}����q���2�t�z�z�*���	rJr|rTc�~��t�|�||�\}}|tur]|j�1|js%|j|�}tj}||fS|j}tj}||fS|jrK|�Itd�|D��r7|D�cgc]}|tur|jn|��}}tj}||fS|dtjhvrQ|j�E|js|jr-|js!|j|�}tj}||fScc}w)Nc3�,K�|]}|tu���y�wrNr)r5�vs  r<r6z'Option.consume_value.<locals>.<genexpr>�s����:�q�A�*�*�:�s�)rhr1rrr�r�rkrur^rqr��anyrsr�r\)r�r,r|r�r�r�r s      �r<r1zOption.consume_valuess:�����-�c�4�8�
��v�
�%�%��{�{�&�s�/D�/D��-�-�c�2��(�/�/��0�f�}��-����(�4�4��*�f�}��%
�M�M��!��:�E�:�:�OT�U�!��->�(>�T�_�_�A�E�U�E�U�$�0�0�F��f�}��
�t�_�4�4�5�5����'����$�"6�"6��)�)��)�)�#�.�E�$�+�+�F��f�}���Vs�D:)NNFFTFNNFFTNNFTFrr)"rGrlrmrnrr2rr_rrrgrrrWr�rr�rfr
rrr-r�r�rr�rr�rIr0rXrkr1r�r�s@r<r�r��	s����:�x�O�48�15�%*�27� $� �$(�(,���#'�<@� $��!�!�#tL��Z�Z��
�
�3��0�tL��g�g�d�C��o�.�tL�����c�	�"�	tL�
�W�W�T�3�Y�/�tL��
tL��tL����D�!�tL��J�J�q�u�u�%�tL��tL��tL�!�tL��j�j�������!�%�%�!7�8�9�tL��j�j��o�tL��tL� �!tL�"�#tL�$���%tL�&
�'tL�l
�a�f�f�S�!�%�%�Z�0�
�3*��Z�Z��_�3*�48�3*�	
������C��!�&�&��+�q�v�v�c�{�:�	;�3*�j%�L�%�w�%�4�%�NjG�7�jG�q�z�z�!�'�'�#�s�(�:K�/L�jG�X�Z�Z�7;����"4��	
���A�E�E�	����
�Z�Z�),����"&��	
���A�G�G�A�E�E�1�:�:�b�!�%�%�i�#8�8�9�	:����*.�3��3�"&�3�	
���A�G�G�A�E�E�1�:�:�b�!�%�%�i�#8�8�9�	:�3� 
�G�
����
�4���A�J�J�s�O��&�W�����A�E�E�1B�� #��#�"#�)�)�C��,<�"=�#�	
�������'�	(�#�#rJr�c
���eZdZdZdZ	ddejedeje	dejddf�fd�
Zedefd	��Z
defd
�Zdejede	dejejeej eej effd
�Zdedej efd�Zdedefd�Zdededdfd�Z�xZS)r�aArguments 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`.
    �argumentNrr�r�r/c����|�)|jd��d}n|jdd�dkD}d|vrtd��t�|�|fd|i|��	|j�|j
d	k(rtd
��yy)NrFrrrr�z9__init__() got an unexpected keyword argument 'multiple'.r�r3z('default' is not supported for nargs=-1.)r�r�rhr�rr)r�rr�r�r s    �r<r�zArgument.__init__�s�������y�y��#�/� �� �9�9�W�a�0�1�4������W�X�X�
����A�x�A�5�A���|�|�'�D�J�J�"�,<�� J�K�K�-=�'rJc�f�|j�|jS|jj�SrN)rr;r�r�s r<r#zArgument.human_readable_name�s'���<�<�#��<�<���y�y��� � rJc���|j�|jS|jj|�}|s|jj	�}|j
sd|�d�}|jdk7r|dz
}|S)Nr�r�rr%)rrFr&r;r�r�r)r�r�s  r<r'zArgument.make_metavar�sj���<�<�#��<�<���i�i�#�#�D�)����)�)�/�/�#�C��}�}��c�U�!�*�C��:�:��?��5�L�C��
rJr r�c���|s|sdggfStd��t|�dk(r(|dx}}|jdd�j�}ntdt|��d���||ggfS)Nz%Could not determine name for argumentrrr�r�z6Arguments take exactly one parameter declaration, got rV)r�r�r�rt)r�r r�r;�args     r<rzArgument._parse_decls�s������R��|�#��C�D�D��u�:��?��q��!�D�3��<�<��S�)�/�/�1�D�����J�<�q�"��
��c�U�B��rJr,c�$�|j�gSrN�r'rs  r<r�zArgument.get_usage_pieces�s���!�!�#�$�$rJc�*�d|j��d�S)NrSr�rs  r<rUzArgument.get_error_hint�s���4�$�$�&�'�q�)�)rJr�c�T�|j|j|j|��y)N)r}rr{)�add_argumentr;rr.s   r<r�zArgument.add_to_parser�s��������$�*�*�$��GrJrN)rGrlrmrnrr2r_rrrgrr�rr#r'rfr
rr-r�rUrr�r�r�s@r<r�r��s����!�O�
&*�L��Z�Z��_�L��*�*�T�"�L����	L�

�L�*�!�S�!��!�

�c�
���Z�Z��_��48��	
������C��!�&�&��+�q�v�v�c�{�:�	;��"%�G�%����s��%�*�'�*�c�*�H�L�H�w�H�4�HrJr�r�rN)VrorPr�rHrF�typingr2�collectionsr�
contextlibrr�	functoolsrrr�r�	itertoolsr	rr
r��
exceptionsrrrrrr�
formattingrr�globalsrrr�rrr�termuirrr �utilsr!r"r#r$r%r&�
TYPE_CHECKING�typing_extensions�terYr(�TypeVarrrr)r+rrrfr=rgrI�Iterabler	r
rRrrWr_ri�Enumrkr-rr0r4r�rrrTr�r�rvrJr<�<module>r�s������	�
���%� �$� ������$�&��(�"�%�$� �!�%� �����'���*��%��?�?�"�0�
�A�I�I�c����C����J�/�0��
�A�I�I�c�N��$�	�$� #�$��Z�Z�����Y��'�(�$�(SX�� ��,/��6?��KO��	��0:�A�J�J�q�M�:�s�:�q�v�v�a�g�g�a��f�o�7N�:��59��	���:�:�k�2���Z�Z������$3��j�j��-�3��z�z�+�.�3��V�V�K��3�(A�d�i�i�A�4_
0�_
0�DC*�C*�L
u�k�u�p	r�7�r�j	m%�L�m%�`*��*�Z�q�u�u�����A�E�E�!2��r?�r?�j
E�Y�E�PIH�y�IHrJ

Zerion Mini Shell 1.0