Sindbad~EG File Manager

Current Path : /home/infinitibizsol/mypythonenv/lib/python3.6/site-packages/click/__pycache__/
Upload File :
Current File : /home/infinitibizsol/mypythonenv/lib/python3.6/site-packages/click/__pycache__/core.cpython-36.pyc

3

+ĜgH��@sTddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZddlm
Z
ddlmZddlmZddlmZdd	lmZd
dlmZd
dlmZd
d
lmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlm Z d
dlm!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-m0Z0d
d l-m1Z1d
d!l-m2Z2d
d"l-m3Z3ej4�r�ddl5Z6d
d#l7m8Z8ej9d$ej:d%ej;fd&�Z<ej9d'�Z=d(e>ej?ej@e>d)fd*�d+d,�ZAdOd.e>d)eBdd/�d0d1�ZCejDe=eEejFej@e=d%fd2�d3d4�ZGe
dPd(ejHd5ej?dd6�d7d8��ZIejJd5ejJd5ejFd5d9�d:d;�ZKGd<d=�d=ejL�ZMGd>d(�d(�ZNGd?d@�d@�ZOGdAd)�d)eO�ZPGdBd.�d.eP�ZQGdCdD�dDeQ�ZRGdEdF�dFeQ�ZSej;ej?ej;dG�dHdI�ZTGdJd5�d5�ZUGdKdL�dLeU�ZVGdMdN�dNeU�ZWdS)Q�N)�abc)�contextmanager)�	ExitStack)�partial)�update_wrapper)�gettext)�ngettext)�repeat�)�types)�_verify_python_env)�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.)Zbound�V�Context�Command)�ctx�
incomplete�returnccsVtjt|j�}xB|j|�D]4}|j|�r|j||�}|dk	r|jr||fVqWdS)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)Zmulti�namer.�r4�+/tmp/pip-build-fsllo_ck/click/click/core.py�_complete_visible_commands1s	
r6Fr-)�base_command�cmd_name�cmd�registerr*cCsl|jst|t�rdS|r"d}nd}t|�d|j�d|�d|�dt|�j�dt|�j�d|j�d	���dS)
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�
isinstancer-�RuntimeErrorr3�type�__name__)r7r8r9r:Zhintr4r4r5�_check_multicommandDsr@)�iterable�
batch_sizer*cCstttt|�|���S)N)�list�zipr	�iter)rArBr4r4r5�batch\srF�	Parameter)r(�paramr*ccs�y
dVWn~tk
rV}z0|jdkr,||_|dk	rD|jdkrD||_�WYdd}~Xn4tk
r�}z|jdkrv||_�WYdd}~XnXdS)z>Context manager that attaches extra information to exceptions.N)rr(rHr)r(rH�er4r4r5�augment_usage_errors`s


rJ)�invocation_order�declaration_orderr*cs*dtjttfd��fdd�}t||d�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.
    rG)�itemr*cs8y�j|�}Wntk
r*td�}YnX|j|fS)N�inf)�index�
ValueError�float�is_eager)rM�idx)rKr4r5�sort_key|s
z,iter_params_for_processing.<locals>.sort_key)�key)r+�Tuple�boolrQ�sorted)rKrLrTr4)rKr5�iter_params_for_processingss	rYc@s8eZdZdZej�Zej�Zej�Zej�Z	ej�Z
dS)�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)r?�
__module__�__qualname__�__doc__�enum�auto�COMMANDLINE�ENVIRONMENT�DEFAULT�DEFAULT_MAP�PROMPTr4r4r4r5rZ�srZc@seZdZUdZeZejddNdejdeje	ejej
eje	ejeje	ej
fejeejee
eje
eje
eje
ejeje	ejeje	ge	feje
eje
dd�dd�Zeje	ej
fd	�d
d�Zdd	�dd
�Zdd�ZedOe
ejdd�dd��Zeeje	ej
fd	�dd��Zed	�dd�Zejeed�dd�Zejdej
fejdej
fd�dd�Zdd	�dd �Zee	d	�d!d"��Zdd	�d#d$�Z ejeejed%�d&d'�Z!ejeed%�d(d)�Z"ej#dPe	d*ejej
d+�d,d-��Z$ej#dQe	d.ejej%ej
ejgej
ffd+�d/d-��Z$dRe	e
ejej
d+�d0d-�Z$e	d1d2�d3d4�Z&d1d	�d5d6�Z'dSed1d8�d9d:�Z(e	d	�d;d<�Z)e	d	�d=d>�Z*ddd?�d@dA�Z+ej%dejdej
ffej
ej
ej
dB�dCdD�Z,dej
ej
ej
dE�dFdG�Z-e	e.ddH�dIdJ�Z/e	eje.dK�dLdM�Z0dS)Tr&aThe 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 defaults for all options. If not set,
        defaults to the value from a parent context. Overrides an
        option's ``show_default`` argument.

    .. 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.
    rNFr')r.�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*cCs||_||_||_i|_g|_g|_|dkr:|dk	r:|j}||_t|di�|_|dkr||dk	r||dk	r||j	dk	r||j	j
|�}||_	d|_|dkr�|dk	r�|j}||_|dkr�|dk	r�|j
}||_
|
dkr�|j}
|
|_|dkr�|j}||_|dkr�|j}||_|
dk�r|dk	�r|j}
ndg}
|
|_|dk�r>|dk	�r>|j}||_|	|_|dk�r�|dk	�r�|jdk	�r�|jdk	�r�|j�d|jj���}n|j�}|dk	�r�|jdd�}||_|dk�r�|dk	�r�|j}||_|dk�r�|dk	�r�|j}||_g|_d|_i|_t�|_dS)N�metaz--help�_�-r)rer.rf�params�args�protected_argsrg�getattr�_metari�get�invoked_subcommandrjrkrmrnrorprqrlrh�upper�replacerrrsZ_close_callbacks�_depth�_parameter_sourcer�_exit_stack)�selfr.rerfrgrhrirjrkrlrmrnrorprqrrrsr4r4r5�__init__sx






zContext.__init__)r*cCs$|jj|�|j|j|j|j|jd�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
        )r.rfrmrnrorh)r.�to_info_dictrfrmrnrorh)r�r4r4r5r��s
zContext.to_info_dictcCs|jd7_t|�|S)Nr
)r�r)r�r4r4r5�	__enter__�szContext.__enter__cCs*|jd8_|jdkr |j�t�dS)Nr
r)r��closer)r��exc_type�	exc_value�tbr4r4r5�__exit__�s
zContext.__exit__T)�cleanupr*ccsF|s|jd7_z|�}|VWdQRXWd|s@|jd8_XdS)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.
        r
N)r�)r�r��rvr4r4r5�scope�sz
Context.scopecCs|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�r4r4r5rt�szContext.metacCs|j|j|jd�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)�formatter_classrjrk)r�r4r4r5�make_formatters
zContext.make_formatter)�context_managerr*cCs|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�r4r4r5�
with_resourceszContext.with_resource.)�fr*cCs|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�r4r4r5�
call_on_close7s
zContext.call_on_closecCs|jj�t�|_dS)z�Invoke all close callbacks registered with
        :meth:`call_on_close`, and exit all context managers entered
        with :meth:`with_resource`.
        N)r�r�r)r�r4r4r5r�Cs
z
Context.closecCszd}|jdk	r|j}|jdk	rr|jjg}t|jjt�r^x&|jjj|�D]}|j|j|��qFWdj	|��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.
        �N� )rfre�command_pathr<r.r'�
get_params�extend�get_usage_pieces�join�lstrip)r�r�Zparent_command_pathrHr4r4r5r�Ls


zContext.command_pathcCs|}x|jdk	r|j}qW|S)zFinds the outermost context.N)re)r��noder4r4r5�	find_root_s
zContext.find_root)�object_typer*cCs.|}x$|dk	r(t|j|�r |jS|j}qWdS)z)Finds the closest object of a given type.N)r<rgre)r�r�r�r4r4r5�find_objectfs

zContext.find_objectcCs"|j|�}|dkr|�|_}|S)z�Like :meth:`find_object` but sets the innermost object to a
        new instance of `object_type` if it does not exist.
        N)r�rg)r�r�r�r4r4r5�
ensure_objectrs
zContext.ensure_objectzte.Literal[True])r3�callr*cCsdS)Nr4)r�r3r�r4r4r5�lookup_default{szContext.lookup_defaultzte.Literal[False]cCsdS)Nr4)r�r3r�r4r4r5r��scCs0|jdk	r,|jj|�}|r(t|�r(|�S|SdS)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)rir|�callable)r�r3r��valuer4r4r5r��s

zte.NoReturn)�messager*cCst||��dS)z�Aborts the execution of the program with a specific error
        message.

        :param message: the error message to fail with.
        N)r)r�r�r4r4r5�fail�szContext.failcCs
t��dS)zAborts the script.N)r
)r�r4r4r5�abort�sz
Context.abortr)�coder*cCst|��dS)z-Exits the application with a given exit code.N)r)r�r�r4r4r5�exit�szContext.exitcCs|jj|�S)zaHelper method to get formatted usage string for the current
        context and command.
        )r.�	get_usage)r�r4r4r5r��szContext.get_usagecCs|jj|�S)z^Helper method to get formatted help page for the current
        context and command.
        )r.�get_help)r�r4r4r5r��szContext.get_help)r.r*cCst|�||j|d�S)zvCreate a new context of the same type as this context, but
        for a new command.

        :meta private:
        )rfre)r>r3)r�r.r4r4r5�_make_sub_context�szContext._make_sub_context)�_Context__callbackrx�kwargsr*cOs�t|t�rx|}|jdkr"td��n|j}|j|�}x6|jD],}|j|kr:|jr:|j||j	|��||j<q:W|jj
|�n|}t|��|�|||�SQRXWdQRXdS)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<r'r��	TypeErrorr�rwr3�expose_value�type_cast_value�get_default�updaterJ)�_Context__selfr�rxr�Z	other_cmdr(rHr4r4r5�invoke�s 



zContext.invoke)�
_Context__cmdrxr�r*cOsJt|t�std��x$|jD]}||kr|j|||<qW|j|f|�|�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.)r<r'r�rwr�)r�r�rxr�rHr4r4r5�forward�s
zContext.forward)r3�sourcer*cCs||j|<dS)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�r3r�r4r4r5�set_parameter_source	szContext.set_parameter_source)r3r*cCs|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�r3r4r4r5�get_parameter_sourceszContext.get_parameter_source)NNNNNNNFNNNNNNN)T)T).)T)r)1r?r[r\r]rr�r+�Type�Optional�str�Any�Dict�intrW�List�Callabler�r�r�r�r�Iteratorr��propertyrtr�ZContextManagerr%r�r�r�r�r�r�r��overloadr��Unionr�r�r�r�r�r�r�r�rZr�r�r4r4r4r5r&�sp
X�%(		.
1
	c	@seZdZUdZeZejedZdZ	dZ
d-ejeejej
eejfdd�dd�Zeej
eejfd�d	d
�Zed�dd
�Zeed�dd�Zeed�dd�Zd.ejeejeejeejed�dd�Zeejeejed�dd�Zeejd�dd�Zeeejdd�dd�Zejd/ejejeejeejedejdd �d!d"��Zejd0ejejeejeejeeejejd �d$d"��Zd1ejejeejeejeeeejejd%�d&d"�Zd2ej
eejfeejedd'�d(d)�Zejejejd*�d+d,�ZdS)3�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.
    FTN)r3�context_settingsr*cCs||_|dkri}||_dS)N)r3r�)r�r3r�r4r4r5r�Fs	zBaseCommand.__init__)r(r*cCs
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
        r3)r3)r�r(r4r4r5r�WszBaseCommand.to_info_dict)r*cCsd|jj�d|j�d�S)N�<r��>)�	__class__r?r3)r�r4r4r5�__repr__eszBaseCommand.__repr__cCstd��dS)NzBase commands cannot get usage)�NotImplementedError)r�r(r4r4r5r�hszBaseCommand.get_usagecCstd��dS)NzBase commands cannot get help)r�)r�r(r4r4r5r�kszBaseCommand.get_help)rfrxre�extrar*c
Kshx&|jj�D]\}}||kr|||<qW|j|f||d�|��}|jdd��|j||�WdQRX|S)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 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.
        )rfreF)r�N)r��items�
context_classr��
parse_args)r�rfrxrer�rUr�r(r4r4r5�make_contextnszBaseCommand.make_context)r(rxr*cCstd��dS)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.N)r�)r�r(rxr4r4r5r��szBaseCommand.parse_argscCstd��dS)z{Given a context, this invokes the command.  The default
        implementation is raising a not implemented error.
        z*Base commands are not invokable by defaultN)r�)r�r(r4r4r5r��szBaseCommand.invoker#)r(r)r*cs^ddlm�g}xH�jdk	rX�j�t�jt�r�jjr|j��fdd�t�|�D��qW|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
        r)r#Nc3s,|]$\}}|�jkr�||j�d�VqdS))�helpN)ry�get_short_help_str)�.0r3r.)r#r(r4r5�	<genexpr>�sz-BaseCommand.shell_complete.<locals>.<genexpr>)	�click.shell_completionr#rer<r.r-r;r�r6)r�r(r)�resultsr4)r#r(r5�shell_complete�s
zBaseCommand.shell_completezte.Literal[True]zte.NoReturn)rx�	prog_name�complete_var�standalone_moder�r*cKsdS)Nr4)r�rxr�r�r�r�r4r4r5�main�s	zBaseCommand.main.cKsdS)Nr4)r�rxr�r�r�r�r4r4r5r��s	)rxr�r�r��windows_expand_argsr�r*c
Ks�t�|dkr4tjdd�}tjdkr<|r<t|�}nt|�}|dkrJt�}|j|||��yy:|j	||f|�� }|j
|�}|s�|S|j�WdQRXWn�tt
fk
r�ttjd�t�d�Yn�tk
�r�}	z |sڂ|	j�tj|	j�WYdd}	~	Xnltk
�rh}	zN|	jtjk�rVtjtjttj��t_tjtjttj��t_tjd�n�WYdd}	~	XnXWnvtk
�r�}	z |�r�tj|	j�n|	jSWYdd}	~	Xn:tk
�r�|�s‚ttd�tjd�tjd�YnXdS)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!)r�sys�argv�osr3rrCr�_main_shell_completionr�r�r��EOFError�KeyboardInterruptr�stderrr
r�showZ	exit_code�OSError�errno�EPIPEr+r,ZTextIOr"�stdoutrru)
r�rxr�r�r�r�r�r(r�rIr4r4r5r��sN5


)�ctx_argsr�r�r*cCs^|dkr d|�d�jdd�j�}tjj|�}|s4dSddlm}||||||�}tj|�dS)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``.
        NruZ	_COMPLETErvr
)r�)	rr~r��environr|�shell_completionr�r�r�)r�r�r�r�Zinstructionr�r�r4r4r5r�Jsz"BaseCommand._main_shell_completion)rxr�r*cOs|j||�S)zAlias for :meth:`main`.)r�)r�rxr�r4r4r5�__call__fszBaseCommand.__call__)N)N)NNNT)NNN.)NNNTT)N)r?r[r\r]r&r�r+r�rmrnror�r�r�r�r�r�r�r�r�r�r�r�r�r�r��Sequencer�rWr�r�r4r4r4r5r�%sR

!""$qr�cs�eZdZdZd5ejeejejeejfejej	dejfejej
dejeejeejeejeeeeedd�
�fd	d
�
Ze
ejeejfd��fdd
�Ze
ed�dd�Ze
ej
dd�dd�Ze
edd�dd�Ze
ej
ed�dd�Ze
ej
ed�dd�Ze
ejdd�dd�Ze
ed�dd�Ze
ed�dd�Zd6eed!�d"d#�Ze
edd�d$d%�Ze
edd�d&d'�Ze
edd�d(d)�Ze
edd�d*d+�Ze
ej
eej
ed,�d-d.�Ze
ejd�d/d0�Z e
eej
d1d2��fd3d4�Z!�Z"S)7r'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.

    .. versionchanged:: 2.0
       Added the `context_settings` parameter.
    .. versionchanged:: 8.0
       Added repr showing the command name
    .. versionchanged:: 7.1
       Added the `no_args_is_help` 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.
    :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.
    N�	[OPTIONS]TF.rG)
r3r�r�rwr��epilog�
short_help�options_metavar�add_help_option�no_args_is_helpr2�
deprecatedr*c

snt�j||�||_|pg|_|r:d|kr:|jdd�d}||_||_||_||_|	|_	|
|_
||_||_dS)N�r
r)
�superr�r�rw�splitr�r�r�r�r�r�r2r�)
r�r3r�r�rwr�r�r�r�r�r�r2r�)r�r4r5r��s
zCommand.__init__)r(r*cs@t�j|�}|jdd�|j|�D�|j|j|j|j|jd�|S)NcSsg|]}|j��qSr4)r�)r�rHr4r4r5�
<listcomp>�sz(Command.to_info_dict.<locals>.<listcomp>)rwr�r�r�r2r�)	r�r�r�r�r�r�r�r2r�)r�r(�	info_dict)r�r4r5r��s
zCommand.to_info_dictcCs"|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(�	formatterr4r4r5r��szCommand.get_usagecCs&|j}|j|�}|dk	r"||f�}|S)N)rw�get_help_option)r�r(r��help_optionr4r4r5r��s


zCommand.get_params)r(rr*cCs"|j|�}|j|jdj|��dS)zsWrites the usage line into the formatter.

        This is a low-level method called by :meth:`get_usage`.
        r�N)�collect_usage_piecesZwrite_usager�r�)r�r(r�piecesr4r4r5r�s
zCommand.format_usagecCs:|jr|jgng}x"|j|�D]}|j|j|��qW|S)zhReturns all the pieces that go into the usage line and returns
        it as a list of strings.
        )r�r�r�r�)r�r(r�rHr4r4r5r
�szCommand.collect_usage_piecescCs:t|j�}x&|jD]}|j|j�|j|j�qWt|�S)z&Returns the names for the help option.)�setrprw�difference_update�opts�secondary_optsrC)r�r(Z	all_namesrHr4r4r5�get_help_option_names�s

zCommand.get_help_option_names�OptioncCsH|j|�}|s|jrdStdtdd�dd�}t|ddd|td�d	�S)
zReturns the help option object.NrG)r(rHr�r*cSs*|r&|jr&t|j�|jd�|j�dS)N)rr)rlrr�rrr�)r(rHr�r4r4r5�	show_help�sz*Command.get_help_option.<locals>.show_helpTFzShow this message and exit.)�is_flagrRr�r�r�)rr�r&r�rru)r�r(�help_optionsrr4r4r5r�s
zCommand.get_help_optioncCs,t|�}x|j|�D]}|j||�qW|S)z6Creates the underlying option parser for this command.)rr��
add_to_parser)r�r(�parserrHr4r4r5�make_parserszCommand.make_parsercCs"|j�}|j||�|j�jd�S)zfFormats the help into a string and returns it.

        Calls :meth:`format_help` internally.
        r)r��format_helprr)r�r(rr4r4r5r�	szCommand.get_help�-)�limitr*cCs@|jpd}|r"|jr"t|j|�}|jr8td�j|d�}|j�S)z`Gets short help for the command or makes it by shortening the
        long help string.
        r�z(Deprecated) {text})�text)r�r�r r�ru�format�strip)r�rrr4r4r5r�s
zCommand.get_short_help_strcCs4|j||�|j||�|j||�|j||�dS)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)r�format_help_text�format_options�
format_epilog)r�r(rr4r4r5r szCommand.format_helpc	CsN|jpd}|jr td�j|d�}|rJ|j�|j��|j|�WdQRXdS)z3Writes the help text to the formatter if it exists.r�z(Deprecated) {text})rN)r�r�rur�write_paragraph�indentation�
write_text)r�r(rrr4r4r5r1s

zCommand.format_help_textc	Cs`g}x.|j|�D] }|j|�}|dk	r|j|�qW|r\|jtd���|j|�WdQRXdS)z8Writes all the options into the formatter if they exist.N�Options)r��get_help_record�append�sectionru�write_dl)r�r(rrrHr�r4r4r5r>s
zCommand.format_optionsc	Cs2|jr.|j�|j��|j|j�WdQRXdS)z2Writes the epilog into the formatter if it exists.N)r�r!r"r#)r�r(rr4r4r5r Js
zCommand.format_epilog)r(rxr*cCs�|r.|jr.|jr.t|j�|jd�|j�|j|�}|j|d�\}}}x*t||j	|��D]}|j
|||�\}}q\W|r�|jr�|jr�|jt
ddt|��jdjtt|��d��||_|S)N)rr)rxz&Got unexpected extra argument ({args})z'Got unexpected extra arguments ({args})r�)r�rlrr�rrr�rr�rYr��handle_parse_resultrmr�r�lenrr��mapr�rx)r�r(rxrrZparam_orderrHr�r4r4r5r�Qs 

zCommand.parse_argscCsL|jr,td�j|jd�}tt|dd�dd�|jdk	rH|j|jf|j�SdS)zeGiven a context, this invokes the attached callback (if it exists)
        in the right way.
        z7DeprecationWarning: The command {name!r} is deprecated.)r3Zred)ZfgT)�errN)	r�rurr3rrr�r�rw)r�r(r�r4r4r5r�hs

zCommand.invoker#)r(r)r*cs�ddlm�g}�r��dj�r�xd|j|�D]V�t�t�s.�js.�jr`|j�j	�t
jkr`q.|j���fdd��j
�j�D��q.W|jt�j|���|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
        r)r#c3s&|]}|j��r�|�jd�VqdS))r�N)r0r�)r�r3)r#r)rHr4r5r��sz)Command.shell_complete.<locals>.<genexpr>)r�r#�isalnumr�r<rr2�multipler�r3rZr`r�rrr�r�)r�r(r)r�)r�)r#r)rHr5r�us	
zCommand.shell_complete)NNNNNNr�TFFF)r)#r?r[r\r]r+r�r�r�r�r�r�rWr�r&r�r�r�rrr
rrrrr�r�r�rrrr r�r�r��
__classcell__r4r4)r�r5r'ks<!h 			

c
s�eZdZdZdZdZd(ejee	eje	ejee	ejej
dejfejdd��fdd�
Ze
ejeejfd	��fd
d�Ze
ejed	��fdd
�Ze
edd��fdd�Zd)e	ej
egefd�dd�Zd*e	ej
egefd�dd�Ze
edd�dd�Ze
ejeejed��fdd�Ze
ejd	��fdd�Ze
ejeejejeejeejefd�dd�Ze
eejed�d d!�Ze
ejed	�d"d#�Ze
eejd$d%��fd&d'�Z�Z S)+r-aYA 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.
    TFN.)r3�invoke_without_commandr��subcommand_metavarr;�result_callback�attrsr*c	s�t�j|f|�|dkr|}||_||_|dkr@|r<d}nd}||_||_||_|jr�x(|jD]}t|t	�r`|j
r`td��q`WdS)Nz*COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...zCOMMAND [ARGS]...z<Multi commands in chain mode cannot have optional arguments.)r�r�r�r0r1r;�_result_callbackrwr<�Argument�requiredr=)	r�r3r0r�r1r;r2r3rH)r�r4r5r��s"
zMultiCommand.__init__)r(r*cs~t�j|�}i}xX|j|�D]J}|j||�}|dkr6q|j|�}|jdd��|j|�||<WdQRXqW|j||jd�|S)NF)r�)�commandsr;)r�r�r/r1r�r�r�r;)r�r(rr7r3r.�sub_ctx)r�r4r5r��s
zMultiCommand.to_info_dictcst�j|�}|j|j�|S)N)r�r
r&r1)r�r(r�)r�r4r5r
�sz!MultiCommand.collect_usage_pieces)r(rr*cst�j||�|j||�dS)N)r�r�format_commands)r�r(r)r�r4r5r�szMultiCommand.format_options)rr*csttd���fdd�}|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*csF�j��dks�r��_�S��fdd�}ttjt|����_}|S)Ncs �|f|�|�}�|f|�|�S)Nr4)Z_MultiCommand__valuerxr��inner)r��old_callbackr4r5�functionszAMultiCommand.result_callback.<locals>.decorator.<locals>.function)r4rr+r,r$)r�r<r�)rr�)r�r;r5�	decoratorsz/MultiCommand.result_callback.<locals>.decorator)r$)r�rr=r4)rr�r5r2�szMultiCommand.result_callbackcCs$ddl}|jdtdd�|j|d�S)Nrzb'resultcallback' has been renamed to 'result_callback'. The old name will be removed in Click 8.1.�)�
stacklevel)r)�warnings�warn�DeprecationWarningr2)r�rr@r4r4r5�resultcallback#szMultiCommand.resultcallbackc		Cs�g}x>|j|�D]0}|j||�}|dkr*q|jr2q|j||f�qWt|�r�|jdtdd�|D��}g}x(|D] \}}|j|�}|j||f�qrW|r�|jt	d���|j
|�WdQRXdS)zeExtra format methods for multi methods that adds all the commands
        after the options.
        N�css|]}t|d�VqdS)rN)r*)r�r9r4r4r5r�?sz/MultiCommand.format_commands.<locals>.<genexpr>�Commands)r/r1r2r&r*r��maxr�r'rur()	r�r(rr7�
subcommandr9rZrowsr�r4r4r5r9.s"
zMultiCommand.format_commands)r(rxr*csx|r.|jr.|jr.t|j�|jd�|j�t�j||�}|jrP||_	g|_
n"|rr|dd�|dd�|_	|_
|j
S)N)rrr
)r�rlrr�rrr�r�r�r;ryrx)r�r(rx�rest)r�r4r5r�JszMultiCommand.parse_argsc	's�tjtjd���fdd�}�js^�jrP�� t�j��|�jrDgnd�SQRX�jtd���j�j	�}g�_	g�_�js��b�j
�|�\}}}|dk	s�t�|�_t�j��|j
||�d�}|�||jj|��SQRXWdQRX���|�r�dnd�_t�j��g}xX|�rf�j
�|�\}}}|dk	�s6t�|j
||�ddd	�}|j|�|j	g}|_	�qWg}x0|D](}|�|j|jj|��WdQRX�qrW||�SQRXdS)
N)r�r*cs"�jdk	r�j�j|f�j�}|S)N)r4r�rw)r�)r(r�r4r5�_process_resultZs
z,MultiCommand.invoke.<locals>._process_resultzMissing command.)re�*TF)rermrn)r+r�ryr0r�r�r;r�rurx�resolve_command�AssertionErrorr}r�r.r&)	r�r(rIrxr8r9r8Zcontextsr�)r�)r(r�r5r�YsN 

"zMultiCommand.invokecCs�t|d�}|}|j||�}|dkrD|jdk	rD|j|�}|j||�}|dkr�|jr�t|�drn|j||j�|jtd�j	|d��|r�|nd||dd�fS)NrzNo such command {name!r}.)r3r
)
r!r1rqrlrr�rxr�rur)r�r(rxr8Zoriginal_cmd_namer9r4r4r5rK�s
zMultiCommand.resolve_command)r(r8r*cCst�dS)z{Given a context and a command name, this returns a
        :class:`Command` object if it exists or returns `None`.
        N)r�)r�r(r8r4r4r5r1�szMultiCommand.get_commandcCsgS)zTReturns a list of subcommand names in the order they should
        appear.
        r4)r�r(r4r4r5r/�szMultiCommand.list_commandsr#)r(r)r*cs<ddlm��fdd�t||�D�}|jt�j||��|S)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
        r)r#cs g|]\}}�||j�d��qS))r�)r�)r�r3r.)r#r4r5r�sz/MultiCommand.shell_complete.<locals>.<listcomp>)r�r#r6r�r�r�)r�r(r)r�)r�)r#r5r��s


zMultiCommand.shell_complete)NFNNFN)F)F)!r?r[r\r]rmrnr+r�r�rWr�r�r�r&r�r�r�r
rrr$r2rCr9r�r�rVr'rKr1r/r�r/r4r4)r�r5r-�s02 -"E
,cs4eZdZUdZdZejejedZ	ejej
ejdejef	dejeejej
ej
eefejefejdd��fdd�
Zdeejedd�dd�Zejejejejd	ejfgefd
�dd�Zejejejejd	ejfgdfd
�d
d�Zeeejed�dd�Zeejed�dd�Z�ZS)�GroupaNA 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 ``commmands`` argument can be a list of command objects.
    N)r3r7r3r*csBt�j|f|�|dkri}nt|tj�r8dd�|D�}||_dS)NcSsi|]}|jdk	r||j�qS)N)r3)r��cr4r4r5�
<dictcomp>sz"Group.__init__.<locals>.<dictcomp>)r�r�r<rr�r7)r�r3r7r3)r�r4r5r��szGroup.__init__)r9r3r*cCs8|p|j}|dkrtd��t|||dd�||j|<dS)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)r:)r3r�r@r7)r�r9r3r4r4r5�add_commands

zGroup.add_command.)rxr�r*csRddlm��jdk	r(d�kr(�j�d<tjdtjftd�����fdd�}|S)	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.0
            Added the :attr:`command_class` attribute.
        r
)r.N�cls.)r�r*cs����|�}�j|�|S)N)rP)r�r9)rxr.r�r�r4r5r=)s
z Group.command.<locals>.decorator)�
decoratorsr.�
command_classr+r�r�r')r�rxr�r=r4)rxr.r�r�r5r.s

&z
Group.commandcsjddlm��jdk	r@d�kr@�jtkr6t���d<n
�j�d<tjdtjfdd�����fdd	�}|S)
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.0
            Added the :attr:`group_class` attribute.
        r
)�groupNrQ.rM)r�r*cs����|�}�j|�|S)N)rP)r�r9)rxrTr�r�r4r5r=Fs
zGroup.group.<locals>.decorator)rRrT�group_classr>r+r�r�)r�rxr�r=r4)rxrTr�r�r5rT0s

&zGroup.group)r(r8r*cCs|jj|�S)N)r7r|)r�r(r8r4r4r5r1MszGroup.get_command)r(r*cCs
t|j�S)N)rXr7)r�r(r4r4r5r/PszGroup.list_commands)NN)N)r?r[r\r]rSr+r�r�r'rUr�r>r�r�r�r�r�rPr�r.rTr&r1r�r/r/r4r4)r�r5rM�s
$,&&rMcs�eZdZdZdejeejejeej	dd��fdd�
Z
edd�dd�Zeeeje
d	�d
d�Zeejed�d
d�Z�ZS)�CommandCollectionaA 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.
    N)r3�sourcesr3r*cst�j|f|�|pg|_dS)N)r�r�rW)r�r3rWr3)r�r4r5r�[szCommandCollection.__init__)�	multi_cmdr*cCs|jj|�dS)z1Adds a new multi command to the chain dispatcher.N)rWr&)r�rXr4r4r5�
add_sourceeszCommandCollection.add_source)r(r8r*cCs>x8|jD].}|j||�}|dk	r|jr2t|||�|SqWdS)N)rWr1r;r@)r�r(r8r�r�r4r4r5r1iszCommandCollection.get_command)r(r*cCs.t�}x|jD]}|j|j|��qWt|�S)N)rrWr�r/rX)r�r(r�r�r4r4r5r/uszCommandCollection.list_commands)NN)r?r[r\r]r+r�r�r�r-r�r�rYr&r'r1r/r/r4r4)r�r5rVTsrV)r�r*cCst|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.
    )r<r�r�rE)r�r4r4r5�_check_iter~s
rZc@sbeZdZdZdZd<ejejeejej	e
jejfe
ejej	ejejgejffejejedejgejfejee
ejee
e
ejej	eejefejejedegej	ejdejeffejejeejeegejej	ejeefeffdd�dd	�Zejeejfd
�dd�Zed
�d
d�Zejee
ejejeejeejefd�dd�Zeed
�dd��Zed
�dd�Zejd=edejejd�dd��Zejd>ee
ejej	ejejgejffd�dd��Zd?ee
ejej	ejejgejffd�dd�Zeedd�dd�Zeejeejfejeje fd �d!d"�Z!eejejd#�d$d%�Z"eje
d&�d'd(�Z#eejejd#�d)d*�Z$eejed+�d,d-�Z%eejejd+�d.d/�Z&eejeejfejeejejejefd0�d1d2�Z'eejejeefd+�d3d4�Z(eejed+�d5d6�Z)eed+�d7d8�Z*eeejdd9�d:d;�Z+dS)@rGa�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 later 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.
    Z	parameterNFTr#)�param_declsr>r6�defaultr��nargsr.�metavarr�rR�envvarr��autocompletionr*cs�|j|p
f|	�\|_|_|_tj||�|_|dkrH|jjrD|jj}nd}||_	||_
||_||_|	|_
||_|
|_||_||_�dk	r�ddl}|jdtdd�tdttjdd��fd	d
�}||_|jjr�||jjkr�td|jj�d|j�d
|�d���t|��s|nd}|dk	�r�|�rNytt|�d�}Wn tk
�rLtd�d�YnX|dk�r�|dk	�r�yt|�Wn0tk
�r�|�r�d}nd}t|�d�YnX|dk�r�t|�|k�r�|�r�dnd}td|�d|�d���dS)Nr
rz�'autocompletion' is renamed to 'shell_complete'. The old name is deprecated and will be removed in Click 8.1. See the docs about 'Parameter' for information about new behavior.r>)r?rGr#)r(rHr)r*csrddlm}g}x\�|g|�D]L}t|t�rB||d|dd�}nt|t�rT||�}|jj|�r|j|�qW|S)Nr)r#r
)r�)r�r#r<�tupler�r�r0r&)r(rHr)r#�outrN)r`r4r5r�s

z*Parameter.__init__.<locals>.shell_completez'nargs' must be z (or None) for type z
, but it was �.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.zitem length�lengthz
'default' z must match nargs=) �_parse_declsr3rrr�convert_typer>�is_composite�arityr6r�r]r.r�r\rRr^r_r@rArBr&r�r+r��_custom_shell_completerPr��nextrZr�r*)r�r[r>r6r\r�r]r.r^r�rRr_r�r`r@�
check_defaultr��subjectr4)r`r5r��sb
 

zParameter.__init__)r*cCs2|j|j|j|j|jj�|j|j|j|j	|j
d�
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
        )
r3�param_type_namerrr>r6r]r.r\r_)r3rmrrr>r�r6r]r.r\r_)r�r4r4r5r�Ls
zParameter.to_info_dictcCsd|jj�d|j�d�S)Nr�r�r�)r�r?r3)r�r4r4r5r�bszParameter.__repr__)�declsr�r*cCs
t��dS)N)r�)r�rnr�r4r4r5reeszParameter._parse_declscCs|jS)z�Returns the human readable name of this parameter.  This is the
        same as the name for options, but the metavar for arguments.
        )r3)r�r4r4r5�human_readable_namejszParameter.human_readable_namecCsF|jdk	r|jS|jj|�}|dkr0|jjj�}|jdkrB|d7}|S)Nr
z...)r^r>�get_metavarr3r~r])r�r^r4r4r5�make_metavarqs

zParameter.make_metavarzte.Literal[True])r(r�r*cCsdS)Nr4)r�r(r�r4r4r5r�szParameter.get_default.cCsdS)Nr4)r�r(r�r4r4r5r��scCs4|j|jdd�}|dkr|j}|r0t|�r0|�}|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�N)r�r3r\r�)r�r(r�r�r4r4r5r��s)rr(r*cCs
t��dS)N)r�)r�rr(r4r4r5r�szParameter.add_to_parser)r(rr*cCsd|j|j�}tj}|dkr*|j|�}tj}|dkrD|j|j�}tj}|dkr\|j|�}tj	}||fS)N)
r|r3rZr`�value_from_envvarrar�rcr�rb)r�r(rr�r�r4r4r5�
consume_value�s

zParameter.consume_value)r(r�r*cs�|dkr �js�jdkrfSdStjtjd���fdd���jdksL�jjr^t�j��d��nD�jd
kr�tjtjd����fdd��ntjtjd����fd	d���jr�t	�fd
d��|�D��S�|�S)zuConvert and validate a value against the option's
        :attr:`type`, :attr:`multiple`, and :attr:`nargs`.
        Nr
)r�r*cs6yt|�Stk
r0ttd���d�d�YnXdS)NzValue must be an iterable.)r(rH)rZr�rru)r�)r(r�r4r5�
check_iter�sz-Parameter.type_cast_value.<locals>.check_iter)rHr(cst��fdd��|�D��S)Nc3s|]}�j|���VqdS)N)r>)r��x)r(r�r4r5r��sz=Parameter.type_cast_value.<locals>.convert.<locals>.<genexpr>)ra)r�)rtr(r�r4r5�convert�sz*Parameter.type_cast_value.<locals>.convertcs\t�|��}t|��jkrDttddt|��j�jt|�d���d��t��fdd�|D��S)Nz%Takes {nargs} values but 1 was given.z*Takes {nargs} values but {len} were given.)r]r*)r(rHc3s|]}�j|���VqdS)N)r>)r�ru)r(r�r4r5r��sz=Parameter.type_cast_value.<locals>.convert.<locals>.<genexpr>)rar*r]rrr)r�)rtr(r�r4r5rv�s
c3s|]}�|�VqdS)Nr4)r�ru)rvr4r5r��sz,Parameter.type_cast_value.<locals>.<genexpr>���rw)
r.r]r+r�r�r>rgrrVra)r�r(r�r4)rtrvr(r�r5r��s
zParameter.type_cast_value)r�r*cCs,|dkrdS|jdks|jr(|fkr(dSdS)NTr
F)r]r.)r�r�r4r4r5�value_is_missing�s
zParameter.value_is_missingcCsD|j||�}|jr(|j|�r(t||d��|jdk	r@|j|||�}|S)N)r(rH)r�r6rxrr�)r�r(r�r4r4r5�
process_value�s
zParameter.process_value)r(r*cCsZ|jdkrdSt|jt�r2tjj|j�}|rV|Sn$x"|jD]}tjj|�}|r:|Sq:WdS)N)r_r<r�r�r�r|)r�r(r�r_r4r4r5�resolve_envvar_value		s
zParameter.resolve_envvar_valuecCs,|j|�}|dk	r(|jdkr(|jj|�}|S)Nr
)rzr]r>�split_envvar_value)r�r(r�r4r4r5rr	s
zParameter.value_from_envvar)r(rrxr*cCs�t||d��V|j||�\}}|j|j|�y|j||�}Wn tk
r\|jsT�d}YnXWdQRX|jrz||j|j<||fS)N)rH)	rJrsr�r3ry�	Exceptionrlr�rw)r�r(rrxr�r�r4r4r5r)#	szParameter.handle_parse_resultcCsdS)Nr4)r�r(r4r4r5r%7	szParameter.get_help_recordcCsgS)Nr4)r�r(r4r4r5r�:	szParameter.get_usage_piecescCs"|jp|jg}djdd�|D��S)z{Get a stringified version of the param for use in error messages to
        indicate which param caused the error.
        z / css|]}d|�d�VqdS)�'Nr4)r�rur4r4r5r�B	sz+Parameter.get_error_hint.<locals>.<genexpr>)rror�)r�r(Z	hint_listr4r4r5�get_error_hint=	szParameter.get_error_hint)r(r)r*csj|jdk	rZ|j|||�}|rHt|dt�rHddlm��fdd�|D�}tjtjd|�S|jj	|||�S)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
        Nr)r#csg|]}�|��qSr4r4)r�rN)r#r4r5rU	sz,Parameter.shell_complete.<locals>.<listcomp>r#)
rir<r�r�r#r+r,r�r>r�)r�r(r)r�r4)r#r5r�D	s
zParameter.shell_complete)
NNFNNNFNTFNNN)T).)T),r?r[r\r]rmr+r�r�r�r�r�	ParamTyper�rWr�r&r�r�rVr�r�r�r�rer�rorqr�r�rr�MappingrZrsr�rxryrzrrr)r%r�r~r�r4r4r4r5rG�sZH�`
,.,2		  cs(eZdZdZdZd&ejejeej	e
efej	e
efej	e
efe
e
eje
ejeje
e
e
ejej	ej
ejfejee
e
e
ejdd��fdd�
Zejeejfd	��fd
d�Zejee
ejejeejeejefd�d
d�Zeedd�dd�Zeejejeefd�dd�Zejd'edejejd�dd��Zejd(ee
ejej	ejejgejffd�dd��Zd)ee
ejej	ejejgejffd��fdd�
Zeejd�dd�Zeejed��fdd�Zeejejd�d d!�Zeejed"fejejefd#��fd$d%�Z �Z!S)*ra�	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: controls if the default value should be shown on the
                         help page. Normally, defaults are not shown. If this
                         value is a string, it shows the string instead of the
                         value. This is particularly useful for dynamic options.
    :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.

    .. versionchanged:: 8.0.1
        ``type`` is detected from ``flag_value`` if given.
    �optionNFT)r[rsr�confirmation_prompt�prompt_required�
hide_inputr�
flag_valuer.�count�allow_from_autoenvr>r�r2�show_choices�show_envvarr3r*cs(d|k}t�j|f||	d�|��|dkrP|jdkr<td��|jjdd�j�}n|dkr^d}n|}||_||_||_||_	||_
|jdk	o�|j|_|dkr�|dk	r�d}q�|jr�d}q�t|j
�}n|dkr�|jr�|dk	|_|r�|r�d|_|dkr�|j}|�r|dk�rtjd|�|_||_|�o0t|jtj�|_||_|
|_|
�rj|dk�r^tjdd	�|_|�rjd|_||_|
|_||_||_||_|jdk�r�td��|j�r�|j�r�|j�r�td��|j�r�|j
�r�td
��|j�r�|j	�r�|jdk	�r�td��|j�r$|j�rtd��|j�r$td��dS)Nr\)r>r.Tz&'name' is required with 'prompt=True'.rur�Fr)�minr
z&nargs=-1 is not supported for options.z+'prompt' is not valid for non-boolean flag.z1Secondary flag is not valid for non-boolean flag.z9'prompt' with 'hide_input' is not valid for boolean flag.z%'count' is not valid with 'multiple'.z$'count' is not valid with 'is_flag'.rw) r�r�r3r�r�
capitalizerr�r�r�r2rrWrr\rrfr>rr<Z
BoolParamType�is_bool_flagr�r�ZIntRanger�r�rsr�r�r]r.)r�r[rsrr�r�r�rr�r.r�r�r>r�r2r�r�r3Zdefault_is_missingZprompt_text)r�r4r5r��	sr


zOption.__init__)r*cs0t�j�}|j|j|j|j|j|j|jd�|S)N)r�rrr�r�r2)	r�r�r�r�rrr�r�r2)r�r)r�r4r5r��	s

zOption.to_info_dict)rnr�r*cCszg}g}d}g}x�|D]�}|j�r@|dk	r:td|�d���|}q|dd�dkrTdnd}||kr�|j|d�\}	}
|	j�}	|	r�|jt|	��|j|	�|
j�}
|
r�|j|
j��|	|
kr�td|�d���q|jt|��|j|�qW|dko�|�r(|jdd	�d
�|ddj	dd
�j
�}|j��s(d}|dk�rJ|�sBd||fStd��|�rp|�rptd|�d|�d���|||fS)NzName 'z' defined twicer
�/�;zBoolean option z) cannot use the same flag for true/false.cSst|d�S)Nr)r*)rur4r4r5�<lambda>'
sz%Option._parse_decls.<locals>.<lambda>)rUrrvruz#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�rrr&rr�rP�sortr�lower)r�rnr�rrr3Zpossible_names�declZ
split_char�first�secondr4r4r5re
sJ




zOption._parse_decls)rr(r*cCs�|jrd}n|jrd}nd}|jr�|�d�}|jrj|jrj|j||j|j|dd�|j||j|j|dd�q�|j||j|j||jd�n|j||j|j||j	d�dS)	Nr&r��storeZ_constT)rgr�dest�action�constF)rgrr�r�r])
r.r�rr�r�
add_optionrr3r�r])r�rr(r�r4r4r5r:
s8

zOption.add_to_parser)r(r*cs��jr
dSd�tjttd���fdd�}|�j�g}�jrL|j|�j���jpTd}g}�jrވj	}|dkr��j
r�|jdk	r��jdk	r�|j�d�jj
���}|dk	r�t|t�r�|ndjdd	�|D��}|jtd
�j|d��|j}d|_z�j|dd
�}	Wd||_Xt�jt�}
|
�s2|	dk	�rڈj�s2|j�r�|
�rHd�j�d�}nvt|	ttf��rndjdd	�|	D��}nPtj|	��r�td�}n:�j�r��j�r�t�j�r��jn�jd�d}nt|	�}|�r�|jtd�j|d��t�jtj��r*�j�o
�jj dk�o
�jj!dk�r*�jj"�}|�r*|j|��j#�r@|jtd��|�rrdj|�}
|�rf|�d|
�d�n
d|
�d�}��r|dndj|�|fS)NF)rr*cs:t|�\}}|rd��jr6�jr6|d�j���7}|S)NTr�)rrr�rq)rr�Zany_slashes)�any_prefix_is_slashr�r4r5�_write_optsg
sz+Option.get_help_record.<locals>._write_optsr�ruz, css|]}t|�VqdS)N)r�)r��dr4r4r5r��
sz)Option.get_help_record.<locals>.<genexpr>zenv var: {var})�varT)r��(�)css|]}t|�VqdS)N)r�)r�r�r4r4r5r��
sz	(dynamic)rr
zdefault: {default})r\r6z; z  [�]�[z / )$r2r+r�r�rrr&r�r�r_r�rhr3r~r<r�rurrlr�rsrCra�inspect�
isfunctionr�rr\r>rZ_NumberRangeBaser�r�rFZ_describe_ranger6)r�r(r�r�r�r�r_Zvar_strZ	resilient�
default_valueZshow_default_is_strZdefault_stringZ	range_strZ	extra_strr4)r�r�r5r%a
sh




&


"zOption.get_help_recordzte.Literal[True])r(r�r*cCsdS)Nr4)r�r(r�r4r4r5r��
szOption.get_default.cCsdS)Nr4)r�r(r�r4r4r5r��
scsL|jr<|jr<x(|jjD]}|j|jkr|jr|jSqWdSt�j||d�S)N)r�)	rr�r.rwr3r\r�r�r�)r�r(r�rH)r�r4r5r��
s
c
sT�jdk	st��j��}�jr*t�j|�St�j|�j�j�j�j��fdd�d�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.
        Ncs�j�|�S)N)ry)ru)r(r�r4r5r��
sz)Option.prompt_for_value.<locals>.<lambda>)r\r>r�r�r�Z
value_proc)	rrLr�r�rr>r�r�r�)r�r(r\r4)r(r�r5�prompt_for_value�
s
zOption.prompt_for_valuecsXt�j|�}|dk	r|S|jrT|jdk	rT|jdk	rT|j�d|jj���}tjj|�}|S)Nru)	r�rzr�rhr3r~r�r�r|)r�r(r�r_)r�r4r5rz�
s

zOption.resolve_envvar_valuecCs^|j|�}|dkrdS|jdkt|j�}|dkrZ|jj|�}|jrZ|jdkrZt||j�}|S)Nr
r)rzr]rWr.r>r{rF)r�r(r�Zvalue_depthr4r4r5rr
s
zOption.value_from_envvarrG)r(rr*cs�t�j||�\}}|tkrL�jdk	r>|jr>�j|�}tj}qˆj}tj	}nv�j
r�|dk	r�tdd�|D��r��fdd�|D�}tj	}n<|dtjhkrˆjdk	rˆj
s��jr�|jrˆj|�}tj}||fS)Ncss|]}|tkVqdS)N)r)r��vr4r4r5r�-sz'Option.consume_value.<locals>.<genexpr>csg|]}|tkr�jn|�qSr4)rr�)r�r�)r�r4r5r/sz(Option.consume_value.<locals>.<listcomp>)r�rsrrrlr�rZrdr�r`r.�anyrbr6r�)r�r(rr�r�)r�)r�r5rss&


zOption.consume_value)NFFFTFNNFFTNNFTF)T).)T)"r?r[r\r]rmr+r�r�r�r�rWr�rrr�r�r�rVr�rerr&rr%r�r�r�r�rzrrr�rZrsr/r4r4)r�r5r\	sL,tZ
,3' c.0rcs�eZdZdZdZdejeeje	ej
dd��fdd�
Zeed�dd	��Z
ed�d
d�Zejee	ejejeejeejefd�d
d�Zeejed�dd�Zeed�dd�Zeedd�dd�Z�ZS)r5z�Arguments 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 parameter constructor.
    ZargumentN)r[r6r3r*cst|dkr,|jd�dk	rd}n|jdd�dk}d|kr<td��t�j|fd|i|��|jdk	rp|jd
krptd	��dS)Nr\Fr]r
rr.z9__init__() got an unexpected keyword argument 'multiple'.r6z('default' is not supported for nargs=-1.rw)r|r�r�r�r\r])r�r[r6r3)r�r4r5r�JszArgument.__init__)r*cCs|jdk	r|jS|jj�S)N)r^r3r~)r�r4r4r5ro_s
zArgument.human_readable_namecCsR|jdk	r|jS|jj|�}|s*|jj�}|js<d|�d�}|jdkrN|d7}|S)Nr�r�r
z...)r^r>rpr3r~r6r])r�r�r4r4r5rqes


zArgument.make_metavar)rnr�r*cCsd|s|sdggfStd��t|�dkrD|d}}|jdd�j�}ntdt|��d���||ggfS)Nz%Could not determine name for argumentr
rrvruz6Arguments take exactly one parameter declaration, got rc)r�r*rr�)r�rnr�r3�argr4r4r5reqs
zArgument._parse_decls)r(r*cCs
|j�gS)N)rq)r�r(r4r4r5r��szArgument.get_usage_piecescCsd|j��d�S)Nr})rq)r�r(r4r4r5r~�szArgument.get_error_hint)rr(r*cCs|j|j|j|d�dS)N)r�r]rg)�add_argumentr3r])r�rr(r4r4r5r�szArgument.add_to_parser)N)r?r[r\r]rmr+r�r�r�rWr�r�r�rorqrVr�rer&r�r~rrr/r4r4)r�r5r5@s
,r5)F)N)Xr^r�r�r�r��typingr+�collectionsr�
contextlibrr�	functoolsrrrrur�	itertoolsr	r�rZ_unicodefunr�
exceptionsr
rrrrrZ
formattingrr�globalsrrrrrrZtermuirrr�utilsrrrr r!r"Z
TYPE_CHECKINGZtyping_extensions�ter�r#ZTypeVarr�r�r$r%r�r�rVr6rWr@�Iterabler�r�rFr�rJr�rY�EnumrZr&r�r'r-rMrVrZrGrr5r4r4r4r5�<module>s�

(	H0A|*
Wg

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists