L i ddlmZddlmZddlZddlZddlZddlZddl Z ddl Z ddl mZddl m Z ddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZd dlmZd dlmZd dlmZd dlm Z d dlm!Z!d dlm"Z"d dlm#Z#d dlm$Z$d 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 dl0m1Z1d dl0m2Z2d d l0m3Z3d d!l4m5Z5d d"l4m6Z6d d#l4m7Z7d d$l4m8Z8d d%l4m9Z9d d&l4m:Z:e jvrd d'ld?eMeK<ZNGd@dAeMZOdQdBZPGdCdDZQGdEdFeQZRGdGdHeQZSdRdIZTy)S) annotationsN)abc)Counter)AbstractContextManager)contextmanager) ExitStack)update_wrapper)gettext)ngettext)repeat) TracebackType)typesFLAG_NEEDS_VALUE)UNSETAbort) BadParameter)ClickException)Exit)MissingParameter)NoArgsIsHelpError UsageError) HelpFormatter) join_options) pop_context) push_context) _OptionParser) _split_opt)confirm)prompt)style)_detect_program_name) _expand_args)echo)make_default_short_help)make_str)PacifyFlushWrapperCompletionItemFt.Callable[..., t.Any])boundVContextc#Ktjt|j}|j |D]<}|j |s|j ||}|*|jr7||f>yw)zList all the subcommands of a group that start with the incomplete value and aren't hidden. :param ctx: Invocation context for the group. :param incomplete: Value being completed. May be empty. N)tcastGroupcommand list_commands startswith get_commandhidden)ctx incompletemultinamer6s P/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/click/core.py_complete_visible_commandsr@6sj FF5#++ &E##C($ ??: &''T2G"7>>Gm# $sA A8 A8" A8/ A8r5Commandc|jrt|tsy|rd|d|jd}t |d|d|jd}t |)Nz$It is not possible to add the group z to another group z that is in chain mode.zFound the group z! as subcommand to another group z. that is in chain mode. This is not supported.)chain isinstancer5r> RuntimeError) base_commandcmd_namecmdregistermessages r?_check_nested_chainrKIs   ZU%;28,?"''**A C  w  xl+!!$$R T  w c Ptttt||ddiS)NstrictF)listzipr iter)iterable batch_sizes r?batchrT]s" VDNJ7FF GGrLc#K dy#t$r.}|j||_||j||_d}~wt$r}|j||_d}~wwxYww)z>Context manager that attaches extra information to exceptions.N)rr;paramr)r;rVes r?augment_usage_errorsrXasa   55=AE  AG  55=AE s.A# A# A ); A AA  A#c*dfd }t||S)a Returns all declared parameters in the order they should be processed. The declared parameters are re-shuffled depending on the order in which they were invoked, as well as the eagerness of each parameters. The invocation order takes precedence over the declaration order. I.e. the order in which the user provided them to the CLI is respected. This behavior and its effect on callback evaluation is detailed at: https://click.palletsprojects.com/en/stable/advanced/#callback-evaluation-order cz j|}|j |fS#t$rtd}Y%wxYw)Ninf)index ValueErrorfloatis_eager)itemidxinvocation_orders r?sort_keyz,iter_params_for_processing..sort_keysF )//5C== #%% ,C s #::key)r` Parameterreturnztuple[bool, float])sorted)rbdeclaration_orderrcs` r?iter_params_for_processingrjts & # 22rLceZdZdZej 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) __name__ __module__ __qualname____doc__enumauto COMMANDLINE ENVIRONMENTDEFAULT DEFAULT_MAPPROMPTrLr?rlrlsY $))+K:$))+K>diikG6$))+KA TYY[F@rLrlc|eZdZUdZeZded< d$ d%dZed&dZ d'dZ d(dZ d)d Z e d*d+d Zed'd Zd,d Zd-d Zd.dZd/dZ d)dZed0dZd(dZd1dZd2dZej4 d* d3dZej4 d4 d5dZd*d6dZd7dZd8dZd9d:dZd0dZd0dZ d;dZ!ej4 dd Z"d?d!Z#d@d"Z$dAd#Z%y)Br1aThe context is a special internal object that holds state relevant for the script execution at every single level. It's normally invisible to commands unless they opt-in to getting access to it. The context is useful as it can pass internal objects around and can control special execution features such as reading data from environment variables. A context can be used as context manager in which case it will call :meth:`close` on teardown. :param command: the command class for this context. :param parent: the parent context. :param info_name: the info name for this invocation. Generally this is the most descriptive name for the script or command. For the toplevel script it is usually the name of the script, for commands below it it's the name of the script. :param obj: an arbitrary object of user data. :param auto_envvar_prefix: the prefix to use for automatic environment variables. If this is `None` then reading from environment variables is disabled. This does not affect manually set environment variables which are always read. :param default_map: a dictionary (like object) with default values for parameters. :param terminal_width: the width of the terminal. The default is inherit from parent context. If no context defines the terminal width then auto detection will be applied. :param max_content_width: the maximum width for content rendered by Click (this currently only affects help pages). This defaults to 80 characters if not overridden. In other words: even if the terminal is larger than that, Click will not format things wider than 80 characters by default. In addition to that, formatters might add some safety mapping on the right. :param resilient_parsing: if this flag is enabled then Click will parse without any interactivity or callback invocation. Default values will also be ignored. This is useful for implementing things such as completion support. :param allow_extra_args: if this is set to `True` then extra arguments at the end will not raise an error and will be kept on the context. The default is to inherit from the command. :param allow_interspersed_args: if this is set to `False` then options and arguments cannot be mixed. The default is to inherit from the command. :param ignore_unknown_options: instructs click to ignore options it does not know and keeps them for later processing. :param help_option_names: optionally a list of strings that define how the default help parameter is named. The default is ``['--help']``. :param token_normalize_func: an optional function that is used to normalize tokens (options, choices, etc.). This for instance can be used to implement case insensitive behavior. :param color: controls if the terminal supports ANSI colors or not. The default is autodetection. This is only needed if ANSI codes are used in texts that Click prints which is by default not the case. This for instance would affect help output. :param show_default: Show the default value for commands. If this value is not set, it defaults to the value from the parent context. ``Command.show_default`` overrides this default for the specific command. .. versionchanged:: 8.2 The ``protected_args`` attribute is deprecated and will be removed in Click 9.0. ``args`` will contain remaining unparsed tokens. .. versionchanged:: 8.1 The ``show_default`` parameter is overridden by ``Command.show_default``, instead of the other way around. .. versionchanged:: 8.0 The ``show_default`` parameter defaults to the value from the parent context. .. versionchanged:: 7.1 Added the ``show_default`` parameter. .. versionchanged:: 4.0 Added the ``color``, ``ignore_unknown_options``, and ``max_content_width`` parameters. .. versionchanged:: 3.0 Added the ``allow_extra_args`` and ``allow_interspersed_args`` parameters. .. versionchanged:: 2.0 Added the ``resilient_parsing``, ``help_option_names``, and ``token_normalize_func`` parameters. ztype[HelpFormatter]formatter_classNc>||_||_||_i|_g|_g|_|rt |jn 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)Nmetaz--help_-r) parentr6 info_nameparamsargs_protected_argsset _opt_prefixesobjgetattr_meta default_mapgetinvoked_subcommandterminal_widthmax_content_widthallow_extra_argsallow_interspersed_argsignore_unknown_optionshelp_option_namestoken_normalize_funcresilient_parsingauto_envvar_prefixupperreplacecolor show_default_close_callbacks_depth_parameter_sourcer _exit_stack)selfr6rrrrrrrrrrrrrrrs r?__init__zContext.__init__s(  ")+ ! +-DJs6+?+?'@PSPU ;6-**C'.vvr'B   %""". ,,00;KCN/3  !f&8#22N+9  $); & 8 8 .?  #&77  !1 " *&-&E&E # .E$ ! )%,%C%C "-C#  $!$*$<$<!%-J!->  'F,>#)#>#> DX! (9  %"--9NN.0014>>3G3G3I2JK#"4!9!9!;   )!3!;!;C!E .@ =V/LLE#(  F$6!..L*6=? =?$;rLcRddl}|jdtd|jS)Nrzo'protected_args' is deprecated and will be removed in Click 9.0. 'args' will contain remaining unparsed tokens. stacklevel)warningswarnDeprecationWarningr)rrs r?protected_argszContext.protected_argss/  >   ###rLc|jj||j|j|j|j |j dS)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 )r6rrrrr)r6 to_info_dictrrrrrrs r?rzContext.to_info_dictsK||006 $ 5 5'+'C'C&*&A&A"&"9"9   rLcF|xjdz c_t||SNr)rrrs r? __enter__zContext.__enter__s q T rLc|xjdzc_d}|jdk(r|j|||}t|S)Nrr)r_close_with_exception_inforrexc_type exc_valuetb exit_results r?__exit__zContext.__exit__sB q #' ;;! 99(IrRK rLc#K|s|xjdz c_ |5}|ddd|s|xjdzc_yy#1swY"xYw#|s|xjdzc_wwxYww)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)rcleanuprvs r?scopez Context.scopesm: KK1 K !   q    q s1A,AAAA,A AA))A,c|jS)aThis 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 )rrs r?r|z Context.metas4zzrLcP|j|j|jS)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)rzrrrs r?make_formatterzContext.make_formatter1s-##%%1G1G$  rLc8|jj|S)aRegister 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)rcontext_managers r? with_resourcezContext.with_resource?s6--o>>rLc8|jj|S)aRegister 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. )rcallback)rfs r? call_on_closezContext.call_on_close\s((++rLc*|jdddy)zInvoke all close callbacks registered with :meth:`call_on_close`, and exit all context managers entered with :meth:`with_resource`. N)rrs r?closez Context.closehs ''dD9rLc^|jj|||}t|_|S)aUnwind the exit stack by calling its :meth:`__exit__` providing the exception information to allow for exception handling by the various resources registered using :meth;`with_resource` :return: Whatever ``exit_stack.__exit__()`` returns. )rrrrs r?rz"Context._close_with_exception_infoos.&&//)RH $;rLcd}|j |j}|j|jjg}t|jjt rJ|jjj |D]"}|j|j|$dj|d|}|jS)zThe computed command path. This is used for the ``usage`` information on the help page. It's automatically created by combining the info names of the chain of contexts to the root.  ) rr command_pathrDr6rA get_paramsextendget_usage_piecesjoinlstrip)rrparent_command_pathrVs r?rzContext.command_paths  >> %B ;; "#';;#;#;"< $++--w7![[00;;DAME'..u/E/Ed/KLMHH012!B48Byy{rLcT|}|j|j}|j|S)zFinds the outermost context.r)rnodes r? find_rootzContext.find_roots+kk%;;Dkk% rLcn|}|1t|j|r |jS|j}|1y)z)Finds the closest object of a given type.N)rDrr)r object_typers r? find_objectzContext.find_objects:#$((K0xx;;D  rLcH|j|}||x|_}|S)zLike :meth:`find_object` but sets the innermost object to a new instance of `object_type` if it does not exist. )rr)rrrs r? ensure_objectzContext.ensure_objects,  k * :'M )DHr rLcyNrxrr>calls r?lookup_defaultzContext.lookup_defaultrLcyrrxrs r?rzContext.lookup_default03rLc|j6|jj|t}|rt|r|S|StS)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. )rrrcallable)rr>rvalues r?rzContext.lookup_defaultsB    '$$((u5EwL rLct||)zAborts the execution of the program with a specific error message. :param message: the error message to fail with. r)rrJs r?failz Context.fails $''rLct)zAborts the script.rrs r?abortz Context.aborts g rLc8|jt|)zExits the application with a given exit code. .. versionchanged:: 8.2 Callbacks and context managers registered with :meth:`call_on_close` and :meth:`with_resource` are closed before exiting. )rr)rcodes r?exitz Context.exits 4jrLc8|jj|S)zaHelper method to get formatted usage string for the current context and command. )r6 get_usagers r?rzContext.get_usages||%%d++rLc8|jj|S)z^Helper method to get formatted help page for the current context and command. )r6get_helprs r?rzContext.get_helps||$$T**rLc>t|||j|S)zvCreate a new context of the same type as this context, but for a new command. :meta private: rr)typer>)rr6s r?_make_sub_contextzContext._make_sub_contexts tDz'W\\$GGrLcyrrxrrrkwargss r?invokezContext.invokes rLcyrrxrs r?rzContext.invokesTWrLcVt|tr|}|j tdt j d|j}|j |}|jD]X}|j|vs|js|j|}|turd}|j||||j<Z|jj|n|}t|5|5||i|cdddcdddS#1swYnxYw dddy#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. .. versionchanged:: 8.0 All ``kwargs`` are tracked in :attr:`params` so they will be passed if :meth:`forward` is called at multiple levels. .. versionchanged:: 3.2 A new context is created, and missing arguments use default values. Nz?The given command does not have a callback that can be invoked.t.Callable[..., V])rDrAr TypeErrorr3r4rrr> expose_value get_defaultrtype_cast_valueupdaterX)rrrr other_cmdr;rV default_values r?rzContext.invokes-( h ( I!!)U66"6 8J8JK((3C")) ::V+0B0B$)$5$5c$:M%-(, ).)>)>]*F5::& $ JJ  f %C !$ ' 1 100 1 1 1 1 1 1 1 1 1 1s$+D.D 6 D D DD(ct|ts td|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.)rDrArrr)rrHrrrVs r?forwardzContext.forward:sd#w'89 9[[ 3EF" $ E 2u  3t{{30000rLc"||j|<y)zSet the source of a parameter. This indicates the location from which the value of the parameter was obtained. :param name: The name of the parameter. :param source: A member of :class:`~click.core.ParameterSource`. N)r)rr>sources r?set_parameter_sourcezContext.set_parameter_sourceMs(.t$rLc8|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. )rr)rr>s r?get_parameter_sourcezContext.get_parameter_sourceVs %%))$//rL)NNNNNNNFNNNNNNN)"r6rArContext | Noner str | Noner t.Any | Nonerr r&cabc.MutableMapping[str, t.Any] | Noner int | Nonerrrboolr bool | Nonerrrrrzlist[str] | Nonerzt.Callable[[str], str] | NonerrrrrgNone)rg list[str]rgdict[str, t.Any])rgr1)rztype[BaseException] | NonerzBaseException | NonerzTracebackType | NonergrT)rrrgzcabc.Iterator[Context])rgr)rzAbstractContextManager[V]rgr0)rr.rgr.)rgrrgstr)rtype[V]rgzV | None)rrrgr0)r>rrt.Literal[True]rgr .)r>rrzt.Literal[False]rg$t.Any | t.Callable[[], t.Any] | None)r>rrrrgr )rJrrg t.NoReturn)rgr)r)rintrgr)r6rArgr1)rrrt.Anyrrrgr0)rrArrrrrgr)rzCommand | t.Callable[..., V]rrrrrgz t.Any | V)rHrArrrrrgr)r>rrrlrgr)r>rrgzParameterSource | None)&rmrnrorprrz__annotations__rpropertyrrrrrrr|rrrrrrrrrr3overloadrrrrrrrrrrr rxrLr?r1r1s`J,9O(8 "& $ )->B%)(,"'(,/3.2.2>B!$(#h'h'h' h'  h' ' h'<h'#h'&h' h'&h'"-h'!,h',h'<h' !h'""#h'$ %h'T $ $ * , (  !   #!#!J6  ?: ,:,( !   $$ ZZ15. ZZ2533/3 -33((, + HZZ*6;GL ZZWW81481@E81QV81 81t1&.0rLc eZdZUdZeZded<dZdZdZ d d!dZ d"dZ d#d Z d$d Z d%d Zd&d Zd'd Zd'dZd(dZd)dZd$dZd*d+dZd&dZd&dZd&dZd&dZ d, d-dZd.dZd/dZd0dZej> d1 d2dZ ej> d3 d4dZ d5 d6dZ d, d7dZ!d8dZ"y)9rAag Commands are the basic building block of command line interfaces in Click. A basic command handles command line parsing and might dispatch more parsing to commands nested below it. :param name: the name of the command to use unless a group overrides it. :param context_settings: an optional dictionary with defaults that are passed to the context object. :param callback: the callback to invoke. This is optional. :param params: the parameters to register with this command. This can be either :class:`Option` or :class:`Argument` objects. :param help: the help string to use for this command. :param epilog: like the help string but it's printed at the end of the help page after everything else. :param short_help: the short help to use for this command. This is shown on the command listing of the parent command. :param add_help_option: by default each command registers a ``--help`` option. This can be disabled by this parameter. :param no_args_is_help: this controls what happens if no arguments are provided. This option is disabled by default. If enabled this will add ``--help`` as argument if no arguments are passed :param hidden: hide this command from help outputs. :param deprecated: If ``True`` or non-empty string, issues a message indicating that the command is deprecated and highlights its deprecation in --help. The message can be customized by using a string as the value. .. versionchanged:: 8.2 This is the base class for all commands, not ``BaseCommand``. ``deprecated`` can be set to a string as well to customize the deprecation message. .. versionchanged:: 8.1 ``help``, ``epilog``, and ``short_help`` are stored unprocessed, all formatting is done when outputting help text, not at init, and is done even if not using the ``@command`` decorator. .. versionchanged:: 8.0 Added a ``repr`` showing the command name. .. versionchanged:: 7.1 Added the ``no_args_is_help`` parameter. .. versionchanged:: 2.0 Added the ``context_settings`` parameter. z type[Context] context_classFTNc ||_|i}||_||_|xsg|_||_||_||_||_| |_d|_ | |_ | |_ | |_ yr) r>context_settingsrrhelpepilogoptions_metavar short_helpadd_help_option _help_optionno_args_is_helpr: deprecated) rr>r&rrr'r(r*r)r+r-r:r.s r?rzCommand.__init__s|&  #! BR! (.|   .$. . $rLc|j|j|Dcgc]}|jc}|j|j|j |j |jdScc}w)N)r>rr'r(r*r:r.)r>rrr'r(r*r:r.)rr;rVs r?rzCommand.to_info_dictsYII9=9MNu))+NIIkk//kk//  NsA2cPd|jjd|jdSN __class__rmr>rs r?__repr__zCommand.__repr__&4>>**+1TYYKq99rLc|j}|j|||jjdS)zmFormats the usage line into a string and returns it. Calls :meth:`format_usage` internally.  )r format_usagegetvaluerstriprr; formatters r?rzCommand.get_usages< &&(  #y)!!#**400rLc*|j}|j|}|g||} ddl}|Dcgc]}|jD]}|}}}t |}d|j D} | D]} |j d| dd|Scc}}w)Nrc32K|]\}}|dkDs |yw)rNrx).0optcounts r? z%Command.get_params..sVjc5ETUIcVs zThe parameter zM is used more than once. Remove its duplicate as parameters should be unique.r)rget_help_optionroptsritemsr) rr;r help_optionrrVrBrG opts_counterduplicate_opts duplicate_opts r?rzCommand.get_paramss**3/  "+v+{+F  %+BEuzzBCBCBDB"4=LVL4F4F4HVN!/   (8OO !   CsBc||j|}|j|jdj|y)zsWrites the usage line into the formatter. This is a low-level method called by :meth:`get_usage`. rN)collect_usage_pieces write_usagerr)rr;r>piecess r?r:zCommand.format_usages3 **3/c..0@ArLc|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. )r)rrr)rr;rrVs r?rNzCommand.collect_usage_pieces sR(,';';d"" #__S) 3E IIe,,S1 2 3 rLct|j}|jD]8}|j|j|j|j :t |S)z&Returns the names for the help option.)rrrdifference_updaterGsecondary_optsrO)rr; all_namesrVs r?get_help_option_nameszCommand.get_help_option_namessW--. [[ >E  ' ' 3  ' '(<(< = >IrLc|j|}|r |jsy|j0ddlm}||||j j |_|jS)zReturns the help option object. Skipped if :attr:`add_help_option` is ``False``. .. versionchanged:: 8.1.8 The help option is now cached to avoid creating it multiple times. Nr)rI)rVr+r, decoratorsrIrpop)rr;rrIs r?rFzCommand.get_help_optionse!66s; (<(<    $ / ,K* +D 1 $  1D    rLclt|}|j|D]}|j|||S)z6Creates the underlying option parser for this command.)r r add_to_parser)rr;parserrVs r? make_parserzCommand.make_parser9s9s#__S) -E    , - rLc|j}|j|||jjdS)zfFormats the help into a string and returns it. Calls :meth:`format_help` internally. r9)r format_helpr;r<r=s r?rzCommand.get_help@s< &&(  i(!!#**400rLcl|jr tj|j}n%|jrt |j|}nd}|j rHt |j trd|j dnd}tdj||}|jS)z`Gets short help for the command or makes it by shortening the long help string. r (DEPRECATED: ) (DEPRECATED){text} {deprecated_message}textdeprecated_message) r*inspectcleandocr'r(r.rDrr}formatstrip)rlimitrfrgs r?get_short_help_strzCommand.get_short_help_strIs ??##DOO4D YY*499erfrgs r?rozCommand.format_help_textqs 99 ##DII.88>qADD ??doos3 02#  23::.@;D   % % '&&( +$$T* + +  + +s 7CCcg}|j|D]'}|j|}||j|)|r5|jt d5|j |dddyy#1swYyxYw)z8Writes all the options into the formatter if they exist.NOptions)rget_help_recordappendsectionr}write_dl)rr;r>rGrVrs r?rpzCommand.format_optionss__S) E&&s+B~ B ""1Y<0 )""4( ) )  ) )s A66A?c|jrZtj|j}|j|j 5|j |dddyy#1swYyxYw)z2Writes the epilog into the formatter if it exists.N)r(rhrirurvrw)rr;r>r(s r?rqzCommand.format_epilogsb ;;%%dkk2F  % % '&&( -$$V, - -  - -s A((A1c |jjD]\}}||vs |||<|j|f||d|}|jd5|j ||ddd|S#1swY|SxYw)aThis 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. rFrN)r&rHr$r parse_args)rrrrextrarerr;s r? make_contextzCommand.make_contexts6//557 #JC%"c  #!d  S6SUS YYuY % ' OOC & '  ' s A22A<c |s#|jr|js t||j|}|j |\}}}t ||j |D]}|j|||\}}|jjD]\}} | tusd|j|<|rj|js^|jsR|jtddt|jdj!t#t$|||_|j(j+|j(|S)N)rz&Got unexpected extra argument ({args})z'Got unexpected extra arguments ({args})r)r-rrr]rrjrhandle_parse_resultrrHrrrr lenrjrmaprrrr) rr;rr\rG param_orderrVr}r>rs r?rzCommand.parse_argss5,,S5J5J#C( (!!#&"("3"3"3">dK/ T__S=QR AE//T4@GAt A::++- (KD%~#' 4  ( ,,S5J5J HH<=I&chhs3~6&7     !5!56 rLcT|jrit|jtrd|jnd}tdj |j |}t t|dd|j'|j|jfi|jSy ) zeGiven a context, this invokes the attached callback (if it exists) in the right way. rrzFDeprecationWarning: The command {name!r} is deprecated.{extra_message})r> extra_messageredfgTerrN) r.rDrr}rjr>r'r$rrr)rr;rrJs r?rzCommand.invokes ??)3DOOS)I!DOO$%r Xf$))=fA  w5)t 4 == $3::dmm:szz: : %rLcxddlmg}rdjs|jD]t t rCj s7js,jjtjurW|jfdgjjDjnjt j t"r;j j$r%|jfdt'Djn|S)aReturn a list of completions for the incomplete value. Looks at the names of options and chained multi-commands. Any command could be part of a chained multi-command, so sibling commands are valid at any point during command completion. :param ctx: Invocation context for this command. :param incomplete: Value being completed. May be empty. .. versionadded:: 8.0 rr+c3hK|])}|jr|j+ywr'N)r8r')rAr>r,r<rVs r?rDz)Command.shell_complete..s3z2#4ejj99s/2c3pK|]-\}}|jvr||j/ywr)rrm)rAr>r6r,r;s r?rDz)Command.shell_complete..s>%g3#6#66#4g.H.H.JKKs36)click.shell_completionr,isalnumrrDOptionr:multipler r>rlrsrrGrTrr6r5rCr@)rr;r<resultsr,rVs `` @@r?shell_completezCommand.shell_completes :(* jm335- "5&1||!NN44UZZ@*667 D%** Du/C/C D $jj$**C#++u-#++2C2C)CC)T jj$rLc yrrxrr prog_name complete_varstandalone_moders r?mainz Command.main&srLc yrrxrs r?rz Command.main0srLc .|4tjdd}tjdk(r|rt |}n t |}| t }|j||| |j||fi|5}|j|}|s |cdddS|jdddyy#1swY xYw#ttf$r*} ttjt| d} ~ wt $r<} |s| j#tj| j$Yd} ~ yd} ~ wt&$r} | j(t(j*k(rt-j.t,j0t3tj4t_t-j.t,j0t3tjt_tjdnYd} ~ yd} ~ wwxYw#t6$r=} |r tj| j$n| j$cYd} ~ SYd} ~ yd} ~ wt$r?|stt9dtjtjdYywxYw)aThis 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 ``"__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. Nrnt)filezAborted!)sysargvosr>r&rOr%_main_shell_completionrrrEOFErrorKeyboardInterruptr'stderrrrshow exit_codeOSErrorerrnoEPIPEr3r4TextIOr*stdoutrr}) rrrrrwindows_expand_argsrr;rrWs r?rz Command.main:sf <88ABJ AJJc|6|jddjdd}d|dj}tjj |}|syddlm}||||||}tj|y)aCheck if the shell is asking for tab completion, process that, then exit early. Called from :meth:`main` before the program is invoked. :param prog_name: Name of the executable in the shell. :param complete_var: Name of the environment variable that holds the completion instruction. Defaults to ``_{PROG_NAME}_COMPLETE``. .. versionchanged:: 8.2.0 Dots (``.``) in ``prog_name`` are replaced with underscores (``_``). Nr~r}. _COMPLETEr)r) rrrenvironrshell_completionrrr)rctx_argsrr complete_name instructionrrs r?rzCommand._main_shell_completionsx$  %--c37??SIM}oY7==?Ljjnn\2  4 D(I|[ Q  rLc&|j|i|S)zAlias for :meth:`main`.)rrrrs r?__call__zCommand.__call__styy$)&))rL) NNNNNNz [OPTIONS]TFFF)r>r r&rrt.Callable[..., t.Any] | Nonerzlist[Parameter] | Noner'r r(r r*r r)r r+rr-rr:rr. bool | strrgrr;r1rgrrr;r1rgr)r;r1rglist[Parameter]r;r1r>rrgrr;r1rgr)r;r1rgz Option | None)r;r1rgr )-)rlrrgrr) rr rrrr rrrgr1r;r1rrrgrr;r1rgrr;r1r<rrglist[CompletionItem])NNNT) rcabc.Sequence[str] | Nonerr rr rrrrrgr)NNN.) rrrr rr rrrrrgr)NNNTT)rrrr rr rrrrrrrgr)rzcabc.MutableMapping[str, t.Any]rrrr rgr)rrrrrgr)#rmrnrorpr1r$r rrrrrr6rrr:rNrVrFr]rrmr_rorprqrrrrr3r"rrrrxrLr?rArAis-d$+M=*## DH26)-!!%&1 $ %!&*%*%A*%0 *% ' *%  *%*%*%$*%*%*%*%*% *%X  :12B !61.+"+0 )-"& ### #  #  #J"H; -^ZZ+/ $#'+/ '!  )    ZZ+/ $#' # '!      +/ $#' $$( o'oo! o  o " oo oj$( 1!   @*rLceZdZddZddZy)_FakeSubclassCheckc4t||jdSNr) issubclass __bases__)clssubclasss r?__subclasscheck__z$_FakeSubclassCheck.__subclasscheck__(CMM!$455rLc4t||jdSr)rDr)rinstances r?__instancecheck__z$_FakeSubclassCheck.__instancecheck__rrLN)rrrgr)rrrgr)rmrnrorrrxrLr?rrs 66rLrceZdZdZy) _BaseCommandz\ .. deprecated:: 8.2 Will be removed in Click 9.0. Use ``Command`` instead. NrmrnrorprxrLr?rrrLr) metaclassceZdZUdZdZdZdZded<dZded< d dfd Z dfd Z dd d Z e jd!d Ze j d"d Z d#dZe jd$dZe j d%dZ d&dZd'd(dZd)dZd*dZd*fd Zd+fd Zd+dZd,fd Zd-fd Z d.dZd/fd ZxZS)0r5aA group is a command that nests other commands (or more groups). :param name: The name of the group command. :param commands: Map names to :class:`Command` objects. Can be a list, which will use :attr:`Command.name` as the keys. :param invoke_without_command: Invoke the group's callback even if a subcommand is not given. :param no_args_is_help: If no arguments are given, show the group's help and exit. Defaults to the opposite of ``invoke_without_command``. :param subcommand_metavar: How to represent the subcommand argument in help. The default will represent whether ``chain`` is set or not. :param chain: Allow passing more than one subcommand argument. After parsing a command's arguments, if any arguments remain another command will be matched, and so on. :param result_callback: A function to call after the group's and subcommand's callbacks. The value returned by the subcommand is passed. If ``chain`` is enabled, the value will be a list of values returned by all the commands. If ``invoke_without_command`` is enabled, the value will be the value returned by the group's callback, or an empty list if ``chain`` is enabled. :param kwargs: Other arguments passed to :class:`Command`. .. versionchanged:: 8.0 The ``commands`` argument can be a list of command objects. .. versionchanged:: 8.2 Merged with and replaces the ``MultiCommand`` base class. TFNztype[Command] | None command_classztype[Group] | type[type] | None group_classc t ||fi||i}nAt|tjr'|D cic]} | j | j | }} ||_|| }||_||_||rd}nd}||_ ||_ ||_ |jr:|jD]*} t| ts| jr!tdyycc} w)Nz*COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...zCOMMAND [ARGS]...z5A group in chain mode cannot have optional arguments.)superrrDrSequencer>commandsr-invoke_without_commandsubcommand_metavarrC_result_callbackrArgumentrequiredrE) rr>rrr-rrCresult_callbackrcrVr5s r?rzGroup.__init__s ((  H #,, /+3Jaqvv7I JHJr6sub_ctxr5s r?rzGroup.to_info_dictDsG(- &&s+ ?D&&sD1G++G4Gu- ?!(!5!5g!> ? ? ? ($**=  ? ?s BB& cz|xs |j}| tdt|||d||j|<y)zRegisters another :class:`Command` with this group. If the name is not provided, the name of the command is used. NzCommand has no name.T)rI)r>rrKr)rrHr>s r? add_commandzGroup.add_commandVs?sxx <23 3D$d;! drLcyrrxr _Group__funcs r?r6z Group.command`sBErLcyrrxrs r?r6z Group.commandcs9.decorators,37D3F3A6C   S !JrL)rr.rgrA)rXr6rrrr)rrrfuncrr6s``` @r?r6z Group.commandhs" (.2 HT!W%t9>& I 0GTD   &**U"3"; ..F5M    T? "rLcyrrxrs r?groupz Group.groups>ArLcyrrxrs r?rz Group.groups7:rLc8ddlmd}r+tdrtdk(rrJd\}djAj d0jt urt d<njd<d 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)rNrz5Use 'group(**kwargs)(callable)' to provide arguments.rxrcFi|}j||Srr)rrHrrrrs r?rzGroup.group..decorators,///2C   S !JrL)rr.rgr5)rXrrrrrr)rrrrrrs``` @r?rz Group.groups" &.2 HT!W%t9>& G 0GTD    'FJJu,=,E4' $T u $ 0 0u     T? "rLcdfd }|S)aAdds 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 cjr _Sdfd }ttjt|x_}|S)Nc4|g|i|}|g|i|Srrx)rrrinnerr old_callbacks r?functionz:Group.result_callback..decorator..functions,$U.decoratorsN00L#w()% 1*8q(8KQ)O OD !BIrL)rr-rgr-rx)rrrs`` r?rzGroup.result_callbacks: rLc8|jj|S)z}Given a context and a command name, this returns a :class:`Command` object if it exists or returns ``None``. )rr)rr;rGs r?r9zGroup.get_commands}}  **rLc,t|jS)zCReturns a list of subcommand names in the order they should appear.)rhrrr;s r?r7zGroup.list_commandssdmm$$rLc\t||}|j|j|Sr)rrNr{r)rr;rr5s r?rNzGroup.collect_usage_piecess) W )# . $))* rLcJt||||j||yr)rrpformat_commands)rr;r>r5s r?rpzGroup.format_optionss" sI. S),rLcg}|j|D]7}|j||}||jr%|j||f9t |r|j dz t d|Dz }g}|D])\}}|j|}|j||f+|r5|jtd5|j|dddyyy#1swYyxYw)zeExtra format methods for multi methods that adds all the commands after the options. Nc38K|]}t|dyw)rNr)rArHs r?rDz(Group.format_commands..s-Ncc#a&k-NsCommands) r7r9r:r{rrmaxrmr|r}r}) rr;r>r subcommandrHrlrowsr's r?r zGroup.format_commandss,,S1 /J""3 3C{zz OOZ- . / x=OOa'#-NX-N*NNED#+ 0 C--e4 Z./ 0&&q}5-&&t,-- --s C$$C-c|s#|jr|js t|t|||}|j r||_g|_|jS|r|dd|ddc|_|_|jSr)r-rrrrrCrr)rr;rrestr5s r?rzGroup.parse_args!s~,,S5J5J#C( (w!#t, ::"&C CHxx,0!Hd12h )C xxrLc\dfd }jsWjr15t }|jrgn|cdddSj t dgjj}g_g_js}5j|\}}}|J|_ t |j||}|5||jj|cdddcdddS5|rdnd_ t g}|rXj|\}}}|J|j||dd}|j||jgc}|_|rXg}|D]7}|5|j|jj|ddd9||cdddS#1swYxYw#1swYnxYw ddd#1swYxYw#1swYxYw#1swYyxYw) Ncpj(jj|fij}|Sr)rrrrr;rs r?_process_resultz%Group.invoke.._process_result0s5$$0" 4#8#8%N3::NLrLzMissing command.r*TF)rrrrrrgr) rrrrrCrr}rresolve_commandrrr6r{) rr;rrrrGrHrcontextsr5s `` r?rz Group.invoke/sb  ""**E,B*2DEE HHQ)* +1$$0sxx0  zz L&*&:&:3&E##t&)1&s#**8T#*FL*7??+A+A'+JKLL  L L ',0SdC " GN3  H&*&:&:3&E##t&**%),1 +(%,\\2"glB# ??IIgoo44W=>?? ?#2&3 ' '=EE,LLL  L L LJ??/ ' 's[%G'$AH +!G4 H !A6H" H"!+H H"'G14G= 9H  HH H""H+cpt|d}|}|j||}|/|j#|j|}|j||}|V|jsJt |dr|j |||j tdj||r|nd||ddfS)NrzNo such command {name!r}.r>r) r)r9rrr!rrr}rj)rr;rrGoriginal_cmd_namerHs r?rzGroup.resolve_commandssDG$$sH- ;333?//9H""31C ;s44(#A&T* HHQ23::@Q:R SxD#tABx77rLc ddlm}t||Dcgc]\}}|||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+r)rr,r@rmrrr)rr;r<r,r>r6rr5s r?rzGroup.shell_completesf :"?  s"A)NNFNNFN)r>r rzAcabc.MutableMapping[str, Command] | cabc.Sequence[Command] | Nonerrr-rrr rCrrrrrrgrrr)rHrAr>r rgr)rr.rgrA)rrrrrgz-t.Callable[[t.Callable[..., t.Any]], Command])rrrrrgz7t.Callable[[t.Callable[..., t.Any]], Command] | Command)rr.rgr5)rrrrrgz+t.Callable[[t.Callable[..., t.Any]], Group])rrrrrgz3t.Callable[[t.Callable[..., t.Any]], Group] | GroupF)rrrgzt.Callable[[F], F]r;r1rGrrgzCommand | Nonerrrr)r;r1rrrgz,tuple[str | None, Command | None, list[str]]r)rmrnrorprrrr rrrrr3r"r6rrr9r7rNrpr rrrr __classcell__r5s@r?r5r5s:#+/M'.48K07  ','+)-9=... !% .%.'..7.. .`$"ZZEEZZ<<&+< 6<<''&+' @'RZZAAZZ::&+: 4::**&+* <*X+Z+ % --8 B'H88"+8 586rLceZdZdZy) _MultiCommandzZ .. deprecated:: 8.2 Will be removed in Click 9.0. Use ``Group`` instead. NrrxrLr?r&r&rrLr&cXeZdZdZ d dfd ZddZd fd Zd fd ZxZS) CommandCollectionaA :class:`Group` that looks up subcommands on other groups. If a command is not found on this group, each registered source is checked in order. Parameters on a source are not added to this group, and a source's callback is not invoked when invoking its commands. In other words, this "flattens" commands in many groups into this one group. :param name: The name of the group command. :param sources: A list of :class:`Group` objects to look up commands from. :param kwargs: Other arguments passed to :class:`Group`. .. versionchanged:: 8.2 This is a subclass of ``Group``. Commands are looked up first on this group, then each of its sources. c <t||fi||xsg|_yr)rrsources)rr>r*rr5s r?rzCommandCollection.__init__s" (($+Mr rLc:|jj|y)z$Add a group as a source of commands.N)r*r{)rrs r? add_sourcezCommandCollection.add_sources E"rLct|||}||S|jD]3}|j||}||jr t ||||cSyr)rr9r*rCrK)rr;rGrrr5s r?r9zCommandCollection.get_commandse W h / >Ill F##C2B~::'h;  rLctt| |}|jD]"}|j |j|$t |Sr)rrr7r*rrh)rr;rrr5s r?r7zCommandCollection.list_commandssM57056ll 1F IIf**3/ 0 1bzrL)NN)r>r r*zlist[Group] | Nonerrrgr)rr5rgrr"r) rmrnrorprr,r9r7r#r$s@r?r(r(sO " &*22$2 2  2#"rLr(cDt|trtt|S)ztCheck if the value is iterable but not a string. Raises a type error, or return an iterator over the value. )rDrrrQ)rs r? _check_iterr0s% ;rLc eZdZdZdZdddedddddddddf ddZddZddZ dd Z e dd Z dd Z e j d d!d Ze j d" d#d Z d d#dZd$dZ d%dZd&dZd'dZd&dZd(dZd)dZ d*dZd+dZd,dZddZd-dZy).rfa"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: environment variable(s) that are used to provide a default value for this parameter. This can be a string or a sequence of strings. If a sequence is given, only the first non-empty environment variable is used for the parameter. :param shell_complete: A function that returns custom shell completions. Used instead of the param's type completion if given. Takes ``ctx, param, incomplete`` and must return a list of :class:`~click.shell_completion.CompletionItem` or a list of strings. :param deprecated: If ``True`` or non-empty string, issues a message indicating that the argument is deprecated and highlights its deprecation in --help. The message can be customized by using a string as the value. A deprecated parameter cannot be required, a ValueError will be raised otherwise. .. versionchanged:: 8.2.0 Introduction of ``deprecated``. .. versionchanged:: 8.2 Adding duplicate parameter names to a :class:`~click.core.Command` will result in a ``UserWarning`` being shown. .. versionchanged:: 8.2 Adding duplicate parameter names to a :class:`~click.core.Command` will result in a ``UserWarning`` being shown. .. versionchanged:: 8.0 ``process_value`` validates required parameters and bounded ``nargs``, and invokes the parameter callback before returning the value. This allows the callback to validate prompts. ``full_process_value`` is removed. .. versionchanged:: 8.0 ``autocompletion`` is renamed to ``shell_complete`` and has new semantics described above. The old name is deprecated and will be removed in 8.1, until then it will be wrapped to match the new requirements. .. versionchanged:: 8.0 For ``multiple=True, nargs>1``, the default must be a list of tuples. .. versionchanged:: 8.0 Setting a default is no longer required for ``nargs>1``, it will default to ``None``. ``multiple=True`` or ``nargs=-1`` will default to ``()``. .. versionchanged:: 7.1 Empty environment variables are ignored rather than taking the empty string value. This makes it possible for scripts to clear variables if they can't unset them. .. versionchanged:: 2.0 Changed signature for parameter callback to also be passed the parameter. The old callback format will still work, but it will raise a warning to give you a chance to migrate the code easier. parameterNFTc ||||j|xsd| \|_|_|_t j |||_|/|j jr|j j}nd}||_ ||_ ||_ ||_ | |_ ||_| |_||_| |_| |_| |_ |j jrL||j jk7r3t)d|j jd|j d|d|r6| r3t)d|j*d|j,d |j*d yy) Nrxrz'nargs' must be z (or None) for type z , but it was rzThe z 'z1' is deprecated and still required. A deprecated z cannot be required.) _parse_declsr>rGrTr convert_typer is_compositearityrrnargsrrdefaultr_metavarenvvar_custom_shell_completer.r]param_type_namehuman_readable_name)r param_declsrrr9rr8rr:rr_r;rr.s r?rzParameter.__init__Hsj:   484E4E  2|5 1 49d1&+%7%7g%F  =yy%%        (=D     &4#$ yy%%%499??*B &tyy&78!YYMugQ@ J 4//043K3K2LMF++,,@B'xrLc (|j|j|j|j|jj |j |j|j|jtur |jnd|jd S)aQGather 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. .. versionchanged:: 8.3.0 Returns ``None`` for the :attr:`default` if it was not set. .. versionadded:: 8.0 N) r>r=rGrTrrr8rr9r;) r>r=rGrTrrrr8rr9rr;rs r?rzParameter.to_info_dictspII#33II"11II**, ZZ (,||5'@t||dkk  rLcPd|jjd|jdSr1r4rs r?r6zParameter.__repr__r7rLctrNotImplementedError)rdeclsrs r?r4zParameter._parse_declss "##rLc|jS)zReturns the human readable name of this parameter. This is the same as the name for options, but the metavar for arguments. rrs r?r>zParameter.human_readable_names yyrLc|j |jS|jj||}|$|jjj }|j dk7r|dz }|S)NrVr;r...)r:r get_metavarr>rr8)rr;r:s r? make_metavarzParameter.make_metavarsd << #<< ))''d'< ?iinn**,G ::? u GrLcyrrxrr;rs r?rzParameter.get_defaultrrLcyrrxrMs r?rzParameter.get_defaultrrLc|j|jd}|tur |j}|rt |r|}|S)aGet 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. Fr)rr>rr9r)rr;rrs r?rzParameter.get_defaultsB.""4995"9 E>LLE HUOGE rLctrrCrr\r;s r?r[zParameter.add_to_parsers !##rLc|j|jt}|turtjntj }|tur%|j |}||}tj}|tur5|j|j}|tur|}tj}|tur+|j|}|tur|}tj }||fS)avReturns the parameter value produced by the parser. If the parser did not produce a value from user input, the value is either sourced from the environment variable, the default map, or the parameter's default value. In that order of precedence. If no value is found, an internal sentinel value is returned. :meta private: ) rr>rrlrsruvalue_from_envvarrtrrvr)rr;rGrr envvar_valuedefault_map_valuers r? consume_valuezParameter.consume_valuesE* E!  ' ' ((  E>11#6L'$(44 E> # 2 2499 =  -)(44 E> ,,S1ME)%(00f}rLcN|jsjdk(ry|Sd fd jdk(sjjrd fd n jdk(r d fd nd fd jrt fd|DS|S) zxConvert and validate a value against the parameter's :attr:`type`, :attr:`multiple`, and :attr:`nargs`. rxcf t|S#t$rttddwxYw)NzValue must be an iterable.r;rV)r0rrr}rs r? check_iterz-Parameter.type_cast_value..check_iter+ sA "5)) #23D  s "0rc,j|S)NrHrrs r?convertz*Parameter.type_cast_value..convert: syydy<.convert..@ sPTYYq$4P )tuplerr\r;rs r?r_z*Parameter.type_cast_value..convert? sPj>OPPPrLc  t|}t|jk7rFtt ddt|j jt|tfd|DS)Nz%Takes {nargs} values but 1 was given.z*Takes {nargs} values but {len} were given.)r8rr[c3DK|]}j|ywrr^rbs r?rDz=Parameter.type_cast_value..convert..R sDTYYq$4Drd)rerr8rr rjrfs r?r_z*Parameter.type_cast_value..convertD suj/0u:+& CHJ!&tzzs5z&B"DeDDDrLc3.K|] }|ywrrx)rArcr_s r?rDz,Parameter.type_cast_value..U s??srrrgzcabc.Iterator[t.Any]r)rr8rr6re)rr;rr\r_s`` @@r?rzParameter.type_cast_value! s =}} b 0   ::?dii44 =ZZ2  Q Q  E ==?Z->?? ?u~rLcX|tury|jdk7s |jr|dk(ryy)aA value is considered missing if: - it is :attr:`UNSET`, - or if it is an empty sequence while the parameter is suppose to have non-single value (i.e. :attr:`nargs` is not ``1`` or :attr:`multiple` is set). :meta private: TrrxF)rr8r)rrs r?value_is_missingzParameter.value_is_missingY s+ E> JJ!Ot}}%2+rLc|tur|js|jdk(rd}n|j||}|jr|j |r t |||j|turd}|jjDcic]\}}|tus|d}}}|s|j|||}|S|5|jj||j|||}|jj|Dcic]&}||jvr|j||t(c}ddd|S|Scc}}wcc}w#1swY|SxYw)a2Process the value of this parameter: 1. Type cast the value using :meth:`type_cast_value`. 2. Check if the value is missing (see: :meth:`value_is_missing`), and raise :exc:`MissingParameter` if it is required. 3. If a :attr:`callback` is set, call it to have the value replaced by the result of the callback. If the value was not set, the callback receive ``None``. This keep the legacy behavior as it was before the introduction of the :attr:`UNSET` sentinel. :meta private: rYrxr[N) rrr8rrrlrrrrHr)rr;rkv unset_keyss r? process_valuezParameter.process_valuek sW$ E>}} b 0((e4E ==T2259"s$7 7 == $~/2jj.>.>.@OdaAJ!T'OJO c476 !JJ%%j1 MM#tU;EJJ%%&0 ! !CJJ3::a=3H uH   u =P*  s+E'EAE+E ;EEE#c|jsyt|jtr.tjj |j}|r|Sy|jD]'}tjj |}|s%|cSy)aReturns the value found in the environment variable(s) attached to this parameter. Environment variables values are `always returned as strings `_. This method returns ``None`` if: - the :attr:`envvar` property is not set on the :class:`Parameter`, - the environment variable is not found in the environment, - the variable is found in the environment but its value is empty (i.e. the environment variable is present but has an empty string). If :attr:`envvar` is setup with multiple environment variables, then only the first non-empty value is returned. .. caution:: The raw value extracted from the environment is not normalized and is returned as-is. Any normalization or reconciliation is performed later by the :class:`Parameter`'s :attr:`type`. :meta private: N)r;rDrrrr)rr;rr;s r?resolve_envvar_valuezParameter.resolve_envvar_value su2{{ dkk3 ' ,B ++ ZZ^^F+I  rLc|j|}|*|jdk7r|jj|S|S)a.Process the raw environment variable string for this parameter. Returns the string as-is or splits it into a sequence of strings if the parameter is expecting multiple values (i.e. its :attr:`nargs` property is set to a value other than ``1``). :meta private: r)rsr8rsplit_envvar_value)rr;rs r?rTzParameter.value_from_envvar s= & &s + >djjAo99//3 3 rLcRt||5|j||\}}|j|j||jr|t ur|t jt jfvrtt|jtrd|jnd}tdj|j|j|}tt!|dd  |j#||}d d d |j(rf|j|j*vs|j*|jt ur/|j J|d |j*|j<|fS#t$$r|j&st }YwxYw#1swYxYw) aProcess the value produced by the parser from user input. Always process the value through the Parameter's :attr:`type`, wherever it comes from. If the parameter is deprecated, this method warn the user about it. But only if the value has been explicitly set by the user (and as such, is not coming from a default). :meta private: )rVrrzKDeprecationWarning: The {param_type} {name!r} is deprecated.{extra_message}) param_typer>rrrTrNz9 parameter's name should not be None when exposing value.)rXrWrr>r.rrlrurvrDrr}rjr=r>r'r$rq Exceptionrrr)rr;rGrrrrrJs r?rzParameter.handle_parse_result s"#T 2!  ..sD9ME6  $ $TYY 7&?#:#:O.7 s6qAaS(6s)rGr>r)rr; hint_lists r?get_error_hintzParameter.get_error_hint2 s0II;$":":!; zz6I666rLc|jY|j|||}|r.t|dtrddlm}|Dcgc] }|| }}t j d|S|jj|||Scc}w)aReturn 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) r<rDrrr,r3r4rr)rr;r<rr,rs r?rzParameter.shell_complete9 s  & & 211#tZHG:gaj#6A6=>>!,>>660': :yy''T:>> ?sB)r?rrtypes.ParamType | t.Any | Nonerrr9rrz5t.Callable[[Context, Parameter, t.Any], t.Any] | Noner8rrrr:r rrr_rr;str | cabc.Sequence[str] | NonerzNt.Callable[[Context, Parameter, str], list[CompletionItem] | list[str]] | Noner.rrgrrrrEcabc.Sequence[str]rrrgz'tuple[str | None, list[str], list[str]]rr)r;r1rrrgr r)r;r1rrrgrr\r r;r1rgr)r;r1rGcabc.Mapping[str, t.Any]rgtuple[t.Any, ParameterSource]r;r1rrrgr)rrrgrr;r1rgr )r;r1rgr)r;r1rGrrrrgztuple[t.Any, list[str]]r;r1rgztuple[str, str] | Nonerr)rmrnrorpr=rrrr6r4r!r>rKr3r"rr[rWrrlrqrsrTrrzrrrrxrLr?rfrfs%Xt"O26/39>JN "!26!&7E.E-E E6E H!E"#E$%E&'E()E*+E,0-E./E67E8 9EN 8:$'$7;$ 0$  ZZ48"1 ZZ),33"&3 -33 *."& -B$))":) &)V6p$@D+Z @@":@BK@ @D 7?rLrfceZdZdZdZdddddddedddddddddf dfd Zdfd Zdfd Z dd Z dd Z dd Z dd Z dd Z dfd ZddZ dfd Zdfd ZxZS)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: Show the default value for this option in its help text. Values are not shown by default, unless :attr:`Context.show_default` is ``True``. If this value is a string, it shows that string in parentheses instead of the actual value. This is particularly useful for dynamic options. For single option boolean flags, the default remains hidden if its value is ``False``. :param show_envvar: Controls if an environment variable should be shown on the help page and error messages. Normally, environment variables are not shown. :param prompt: If set to ``True`` or a non empty string then the user will be prompted for input. If set to ``True`` the prompt will be the option name capitalized. A deprecated option cannot be prompted. :param confirmation_prompt: Prompt a second time to confirm the value if it was prompted for. Can be set to a string instead of ``True`` to customize the message. :param prompt_required: If set to ``False``, the user will be prompted for input only when the option was specified as a flag without a value. :param hide_input: If this is ``True`` then the input on the prompt will be hidden from the user. This is useful for password input. :param is_flag: forces this option to act as a flag. The default is auto detection. :param flag_value: which value should be used for this flag if it's enabled. This is set to a boolean automatically if the option string contains a slash to mark two options. :param multiple: if this is set to `True` then the argument is accepted multiple times and recorded. This is similar to ``nargs`` in how it works but supports arbitrary number of arguments. :param count: this flag makes an option increment an integer. :param allow_from_autoenv: if this is enabled then the value of this parameter will be pulled from an environment variable in case a prefix is defined on the context. :param help: the help string. :param hidden: hide this option from help outputs. :param attrs: Other command arguments described in :class:`Parameter`. .. versionchanged:: 8.2 ``envvar`` used with ``flag_value`` will always use the ``flag_value``, previously it would use the value of the environment variable. .. versionchanged:: 8.1 Help text indentation is cleaned here instead of only in the ``@option`` decorator. .. versionchanged:: 8.1 The ``show_default`` parameter overrides ``Context.show_default``. .. versionchanged:: 8.1 The default of a single option boolean flag is not shown if the default value is ``False``. .. versionchanged:: 8.0.1 ``type`` is detected from ``flag_value`` if given. optionNFTc | rtj| } t| |f| | |d||durB|j t d|jj ddj}n |durd}n|}|r!t|trd|dnd }| | |zn|} ||_ ||_ ||_ ||_ ||_|jduxr |j |_|)|t urd}nE|jrd}n6|j"r*d}n'|dur#|js|j$t u|_|r|j$t ur!|j&s|js | rd |_| g|t urt)j*|_nEt|t.rt)j*|_nt)j0d||_t/||_t/|xr$t|j,t(j*|_||_|j4r%|j$t ur|j&sd|_|j$dur#|j6t ur|j6|_|j6t ur|j2rd|_nd|_| |_| r6| t)j:d |_|j$t urd |_| |_| |_||_ ||_!||_" |r |r tGd |jHdk(r t d|j4s|j"r t d|j4r#|jr|j t d|j8r/|jJr t d|j2r t dyy)N)rrr.Tz&'name' is required with 'prompt=True'.r}rFrarbrcrxr)minz)`deprecated` options cannot use `prompt`.rYz&nargs=-1 is not supported for options.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'.)&rhrirrr>rr capitalizerDrr#confirmation_promptprompt_required hide_inputr:_flag_needs_valuerrTr9rr BoolParamTyperrr5is_flag is_bool_flag flag_valuerCIntRangeallow_from_autoenvr'r show_choices show_envvarr]r8r)rr?rr#rrrrrrrCrrr'r:rrr.attrs prompt_textrgr5s r?rzOption.__init__ s|* ##D)D   "X* PU  T>yy  HII&*ii&7&7S&A&L&L&NK u_K K j#. |1-#  150@4,,FXD! #6 .$ "&D!8!UAUAU=U ?&''$$ d&<&<%)\\U%:D " ||u$T]]4;;#%DL|&161D1D1FDI D1 % 3 3 5DI!& 2 24 DDI!'] "&  B 499e.A.AB# ",   ||u$T]]$  <<4 DOO5$@??DL ??e #||"&"& |!NNq1 ||u$  "4 ((& f !LMMzzR HII$$)<)< STT  T__9POzz==#$KLL<<#$JKK rLct|}|j|j|j|j |j tur |j nd|j|j|S)zv .. versionchanged:: 8.3.0 Returns ``None`` for the :attr:`flag_value` if it was not set. N)r'r#rrrCr:) rrrr'r#rrrrCr:)rrr5s r?rzOption.to_info_dict2 sf G(* ;;LL+///*FtD**;;  rLc|t||}|jr|j|d|jdz }|S)Nz (env var: 'z'))rrrr;)rr;resultr5s r?rzOption.get_error_hintE s@',    7  T[[M4 4F rLcg}g}d}g}|D]}|jr|td|d|}'|dddk(rdnd}||vr|j|d\} } | j} | r+|j t | |j | | j } | r|j | j | | k(std|d|j t ||j ||M|rK|jd |d djd d j}|jsd}||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 Srr)rcs r?z%Option._parse_decls..m ss1Q4yjrLrdrr~r}z6Could not determine name for option with declarations z*No options defined but a name was passed (zH). Did you mean to declare an argument instead? Did you mean to pass '--z'?) isidentifierrsplitr<r{r!rr]sortrlower) rrErrGrTr>possible_namesdecl split_charfirstseconds r?r4zOption._parse_declsK s &D  "##fTF/$BCC$(!HOS %$(JJz1$=ME6!LLNE&--j.?@ E*#]]_F&--fmmo>(-dX699 #))*T*:;KK%/ &2 11H R N))rLc|jrd}n|jrd}nd}|jr|d}|jra|jrU|j ||j |j|d|j ||j|j|dy|j ||j |j||jy|j ||j |j||jy) Nr{rCstore_constT)rrGdestactionconstF)rrGrrr8) rrCrrrT add_optionrGr>rr8)rr\r;rs r?r[zOption.add_to_parser s ==F ZZFF <<xv&F  T%8%8!!499499VSW"!!,,! "!!!// "   YYYYjj  rLcjryddfd }|jg}jr!|j|jjxsd}j }g}d|vr<|jt djdj|dd|vr-|jt d j|d d |vr|j|d d |vr|jt |d |r!d j|}|r|d|dnd|d}rd ndj||fS)NFct|\}}|rdjs$js|djz }|S)NTr)r;)rrrCrK)rGr any_slashesany_prefix_is_slashr;rs r? _write_optsz+Option.get_help_record.._write_opts sN+40OB &*#<< $+++4566IrLrenvvarszenv var: {var}, )varr9zdefault: {default})r9rangerz; z [][r|)rGrrgr) r:rGrTr{r'get_help_extrar}rjr) rr;rrr'r extra_items extra_strrs `` @r?rzzOption.get_help_record s] ;;# $))$ %    IIk$"5"56 7yyB##C(     "#**tyyy9I/J*K      q!56==eIFV=W X e    uW~ .     qz!23 4  +.I/3dV3yk+1YKq9ID+<rd|d<|S#||_ wxYw)Nr}rc32K|]}t|ywrrrAds r?rDz(Option.get_help_extra.. s,DSV,DTFrP(rbrc32K|]}t|ywrrrs r?rDz(Option.get_help_extra.. s*Ia3q6*Irz (dynamic)rrrz""r9rr) rr;rrr>rrDrrerrrrrOrrqEnumrh isfunctionr}rrTr!rGrr_NumberRangeBaserCrr_describe_ranger) rr;rr; resilientrrshow_default_is_strdefault_string range_strs r?rzOption.get_help_extra s')   [[F~++..: - # 6 67q9J8KLF!fc*(.yE)$',,DV,D'DE)$ )) $ . ,,Su,=M$-C ! #    ($++S1599#l#00    )++L  mD%=@"#$T%6%6$7q!9MD%=9!%*I=*I!IM4995!.!3!3##M2!";""t':':","/TYYT5H5H!L""""4+>+>}!#"$!%!$]!3#1i  tyy%"8"8 9ZZDIIMMQ$6499==;P 113I!*g == *E*  k%.C !s ,K K c jJj}jr.|tdfvrd}n t |}t j|Si}t jtrj|d<tjf|turdn|jjjjfdd|S)zThis is an alternative flow that can be activated in the full value processing if a value does not exist. It will prompt the user until a valid value exists and then returns the processed value as result. Nrc(j|Sr)rq)rcr;rs r?rz)Option.prompt_for_value..X s!3!3C!;rL)r9rrrr value_proc) r#rrrrr"rDrrrrr)rr;r9 prompt_kwargss`` r?prompt_for_valuezOption.prompt_for_value* s {{&&&""3'   5$-'w-4;;0 0 " d'' .,0,=,=M. ) KK  $u,D'** $ 8 8;    rLc t||}||S|jrd|jX|jL|jd|jj }t jj|}|r|Sy)a:class:`Option` resolves its environment variable the same way as :func:`Parameter.resolve_envvar_value`, but it also supports :attr:`Context.auto_envvar_prefix`. If we could not find an environment from the :attr:`envvar` property, we fallback on :attr:`Context.auto_envvar_prefix` to build dynamiccaly the environment variable name using the :python:`{ctx.auto_envvar_prefix}_{self.name.upper()}` template. :meta private: Nr}) rrsrrr>rrrr)rr;rr;r5s r?rszOption.resolve_envvar_value\ sW )# . >I  # #&&2 %../q1B0CDF'B rLc|j|}|y|jrX|jsL|jtur||jk(r |jSt j j|S|jdk7t|jz}|dkDrN|jj|}|jr%|jdk7rt||j}|S|S)aFor :class:`Option`, this method processes the raw environment variable string the same way as :func:`Parameter.value_from_envvar` does. But in the case of non-boolean flags, the value is analyzed to determine if the flag is activated or not, and returns a boolean of its activation, or the :attr:`flag_value` if the latter is set. This method also takes care of repeated options (i.e. options with :attr:`multiple` set to ``True``). :meta private: Nrr)rsrrrrrr str_to_boolr8rrrrurT)rr;r value_depthmulti_rvs r?rTzOption.value_from_envvarx s & &s + : << 1 1e+doo0E&&&2226 6zzQ$t}}*== ?yy33B7H}}q 4::6O rLct|||\}}|tur]|j1|js%|j |}t j}||fS|j}t j}||fS|jrB|dur>|js2|t jt jfvr|j}||fS|jrs|turk|t jt jfvrIt!d|Dr7|Dcgc]}|tur |jn|}}t j}||fS|tus"|t jt jfvrQ|jE|j"s |j$r-|js!|j |}t j}||fScc}w)aeFor :class:`Option`, the value can be collected from an interactive prompt if the option is a flag that needs a value (and the :attr:`prompt` property is set). Additionally, this method handles flag option that are activated without a value, in which case the :attr:`flag_value` is returned. :meta private: Tc3,K|] }|tuywrr)rAros r?rDz'Option.consume_value.. s9aA))9s)rrWrr#rrrlrwrrsrrrurvrranyrr)rr;rGrrror5s r?rWzOption.consume_value s-c48 v $ ${{&s/D/D--c2(//Tf}O(44Lf}C LL %%668S8STTOOE8f}- MMU"668S8STT9599NST-=(=T__1DTET$00F f}o557R7RSS '$"6"6))))#.E$++Ff}#UsGc|jrC|js7|jr+|tur#d}|j|j |||}|St |||S)NF)rrrrrrrq)rr;rr5s r?rqzOption.process_value s[ << $2C2CQVE}}( c47Lw$S%00rL)&r?rrzbool | str | Noner#rrrrrrrrrrrrrrCrrrrrr'r r:rrrrrr.rrrrgrrrrrr)r;r1rgztypes.OptionHelpExtrarr)r;r1rGzcabc.Mapping[str, Parameter]rgrr)rmrnrorpr=rrrrr4r[rzrrrsrTrWrqr#r$s@r?rrQ s?BO26*."*/ $ #!#'/3!!!&%[L.[L([L [L ( [L  [L[L[L[L[L[L![L-[L[L[L ![L"#[L$%[L&'[L( )[Lz& 5*'5*7;5* 05*n%N+GZRh0 d8(T>>">> &>@11rLrceZdZdZdZ d d fd Zed dZd dZ ddZ ddZ d dZ dd Z xZ S)raArguments are positional parameters to a command. They generally provide fewer features than options but can have infinite ``nargs`` and are required by default. All parameters are passed onwards to the constructor of :class:`Parameter`. argumentc |4|jdttur|jdddkD}nd}d|vr tdt||fd|i|y) Nr9r8rrFrz9__init__() got an unexpected keyword argument 'multiple'.r)rrrrr)rr?rrr5s r?rzArgument.__init__ sg  yyE*e3 99Wa014!  WX X AxA5ArLcf|j |jS|jjSr)r:r>rrs r?r>zArgument.human_readable_name s' << #<< yy  rLc|j |jS|jj||}|s|jj }|j r|dz }|j sd|d}|jdk7r|dz }|S)NrH!rrrrI)r:rrJr>rr.rr8)rr;rs r?rKzArgument.make_metavar s << #<< ii##$C#8))//#C ?? 3JC}}cU!*C ::? 5LC rLc|s|sdggfStdt|dk(r(|dx}}|jddj}ntdt|d|d||ggfS) Nz8Argument is marked as exposed, but does not have a name.rrr~r}z6Arguments take exactly one parameter declaration, got z: r)rrrr)rrErr>args r?r4zArgument._parse_decls' sR|#VW W u:?q !D3<<S)//1DJr8rRs r?r[zArgument.add_to_parser> s$**$GrLr)r?rrrrrrgrrrrrr)rmrnrorpr=rr!r>rKr4rrr[r#r$s@r?rr s!O !%B'BB B  B*!! '7; 0"(-HrLrcddl}|dk(r|jdtdtS|dk(r|jdtdtSt |)Nr BaseCommandzT'BaseCommand' is deprecated and will be removed in Click 9.0. Use 'Command' instead.rr MultiCommandzS'MultiCommand' is deprecated and will be removed in Click 9.0. Use 'Group' instead.)rrrrr&AttributeError)r>rs r? __getattr__rB sh }  "    ~      rL)r;r1r<rrgz"cabc.Iterator[tuple[str, Command]]r!) rFr5rGrrHrArIrrgr)rRzcabc.Iterable[V]rSrrgzlist[tuple[V, ...]]r)r;r1rVzParameter | Nonergzcabc.Iterator[None])rbcabc.Sequence[Parameter]rirrgrrj)r>rrgobject)U __future__rcollections.abcrcabcrqrrhrrtypingr3 collectionsr contextlibrrr functoolsr r r}r itertoolsr rr r_utilsrr exceptionsrrrrrrr formattingrrglobalsrrr\r r!termuir"r#r$utilsr%r&r'r(r)r* TYPE_CHECKINGrr,TypeVarr-r0r@rKrTrXrjrrlr1rArrrr5r&r(r0rfrrrrxrLr?rs"  -% $ $$&()"%$ !!'*%??0 AIIc12 AIIcN$ $!$'$(HM  #& -4 @D   (H,0 )$3.3/336AdiiA4} 0} 0@d *d *N667&8@G@FE%755pc ?c ?L` 1Y` 1FKHyKH\rL