ó
    &ÝNj!•  ã                   ó"  • S SK r S SKrS SKrS SKrS SKrS SKrS SKJr  S SKJ	r	J
r
JrJrJrJrJrJr  SSKJrJrJrJr  SSKJrJr  SSKJrJrJrJr  SSKJrJ r J!r!  SS	K"J#r#  SS
K$J%r%J&r&J'r'  \	(       a  SSK(J)r)  SSKJ*r*  SSK$J+r+   " S S5      r,g)é    N)Úimport_module)ÚTYPE_CHECKINGÚAnyÚDictÚListÚOptionalÚSequenceÚTupleÚTypeé   )Ú
CollectionÚConfigÚExecutorÚFilesystemLoader)ÚcompleteÚprint_completion_script)ÚCollectionNotFoundÚExitÚ
ParseErrorÚUnexpectedExit)ÚArgumentÚParserÚParserContext)Úpty_size)ÚdebugÚenable_loggingÚhelpline)ÚLoader)ÚParseResult)ÚLexiconc                   óŠ  • \ rS rSr% SrS\S'   S\S   4S jrS\S   4S jr\\	   \S	'   S
r
S\
-  rSrS\-  rSr        SES\\	   S\S   S\\	   S\\	   S\\S      S\\S      S\\S      S\\\	      SS4S jjrSFS jrSGS\SS4S jjrSHS	\\\	      S\SS4S  jjrS	\\\	      SS4S! jrSFS" jrSFS# jrSFS$ jrSFS% jrS	\\\	      SS4S& jr\S\	4S' j5       r\S\	4S( j5       r\S\	4S) j5       r\S\\	   4S* j5       r \SIS+ j5       r!\S\"4S, j5       r#SFS- jr$SFS. jr%SFS/ jr&SFS0 jr'S1\"S2\(\	\)4   SS4S3 jr*S\+4S4 jr,SFS5 jr-S\	SS4S6 jr.SFS7 jr/SFS8 jr0SFS9 jr1 SJS:SS;\\\	      S\\2\	\\	   4      4S< jjr3SFS= jr4SKS>\	S\	4S? jjr5 SKS@\6\2\	\\	   4      S>\	SS4SA jjr7SB\6\2\	\\	   4      SS4SC jr8SDr9g)LÚProgramé    aU  
Manages top-level CLI invocation, typically via ``setup.py`` entrypoints.

Designed for distributing Invoke task collections as standalone programs,
but also used internally to implement the ``invoke`` program itself.

.. seealso::
    :ref:`reusing-as-a-binary` for a tutorial/walkthrough of this
    functionality.

.. versionadded:: 1.0
r   ÚcoreÚreturnr   c                 óÌ  • [        S[        SS9[        S[        SSS9[        SS	S
9[        S[        SSS9[        S[        SSS9[        S[        SSS9[        SSSS9[        SSS
9[        SSSS9[        S[        SSS9[        SSSS9[        S [        S!S"S9[        S#[        SS$S9[        S%[        SS&S9[        S'[        SS(S9[        S)[        SS*S9[        S+[        SS,S9/$ )-zL
Return default core `.Argument` objects, as a list.

.. versionadded:: 1.0
)úcommand-timeoutÚTz7Specify a global command execution timeout, in seconds.)ÚnamesÚkindÚhelp)r   Fz:Print tab-completion candidates for given parse remainder.©r)   r*   Údefaultr+   )ÚconfigÚfz"Runtime configuration file to use.©r)   r+   )r   ÚdzEnable debug output.)ÚdryÚRz!Echo commands instead of running.)ÚechoÚez&Echo executed commands before running.)r+   ÚhTz$Show core or per-task help and exit.)r)   Úoptionalr+   )Úhidez*Set default value of run()'s 'hide' kwarg.)ÚlistÚlz8List available tasks, optionally limited to a namespace.)ú
list-depthÚDr   z3When listing tasks, only show the first INT levels.)úlist-formatÚFzbChange the display format used when listing tasks. Should be one of: flat (default), nested, json.Úflat)r)   r+   r-   )úprint-completion-scriptÚ zIPrint the tab-completion script for your preferred shell (bash|zsh|fish).)úprompt-for-sudo-passwordzCPrompt user at start of session for the sudo.password config value.)ÚptyÚpz(Use a pty when executing shell commands.)ÚversionÚVzShow version and exit.)ú	warn-onlyÚwz3Warn, instead of failing, when shell commands fail.)ú	write-pyczEnable creation of .pyc files.)r   ÚintÚboolÚstr©Úselfs    ÚK/home/mande/repo/quber/.venv/lib/python3.13/site-packages/invoke/program.pyÚ	core_argsÚProgram.core_args0   sm  € ô Ø.ÜØNñô
 Ø#ÜØØQñ	ô Ø%Ø9ñô Ø$ÜØØ+ñ	ô Ø"ÜØØ8ñ	ô Ø#ÜØØ=ñ	ô Ø#ØØ;ñô
 ØØAñô Ø#ØØOñô
 Ø)ÜØØJñ	ô Ø*ØyØñô
 Ø2ÜØØ`ñ	ô Ø3ÜØØZñ	ô Ø"ÜØØ?ñ	ô Ø&ÜØØ-ñ	ô Ø(ÜØØJñ	ô Ø$ÜØØ5ñ	ðs_
ð _	
ó    c                 óH   • [        SSS9[        S[        SSS9[        SS	S9/$ )
a%  
Return default task-related `.Argument` objects, as a list.

These are only added to the core args in "task runner" mode (the
default for ``invoke`` itself) - they are omitted when the constructor
is given a non-empty ``namespace`` argument ("bundled namespace" mode).

.. versionadded:: 1.0
)Ú
collectionÚcz Specify collection name to load.r0   )ú	no-dedupeFzDisable task deduplication.r,   )úsearch-rootÚrz4Change root directory used for finding task modules.)r   rK   rM   s    rO   Ú	task_argsÚProgram.task_args˜   sB   € ô Ø)Ø7ñô Ø$ÜØØ2ñ	ô Ø*ØKñð
ð 	
rR   Úargvé   Ú é   é   NrE   Ú	namespacer   ÚnameÚbinaryÚloader_classr   Úexecutor_classr   Úconfig_classr   Úbinary_namesc	                 óÒ   • Uc  SOUU l         X l        X0l        X@l        X€l        / U l        U=(       d    [        U l        U=(       d    [        U l	        U=(       d    [        U l        g)a¶
  
Create a new, parameterized `.Program` instance.

:param str version:
    The program's version, e.g. ``"0.1.0"``. Defaults to ``"unknown"``.

:param namespace:
    A `.Collection` to use as this program's subcommands.

    If ``None`` (the default), the program will behave like ``invoke``,
    seeking a nearby task namespace with a `.Loader` and exposing
    arguments such as :option:`--list` and :option:`--collection` for
    inspecting or selecting specific namespaces.

    If given a `.Collection` object, will use it as if it had been
    handed to :option:`--collection`. Will also update the parser to
    remove references to tasks and task-related options, and display
    the subcommands in ``--help`` output. The result will be a program
    that has a static set of subcommands.

:param str name:
    The program's name, as displayed in ``--version`` output.

    If ``None`` (default), is a capitalized version of the first word
    in the ``argv`` handed to `.run`. For example, when invoked from a
    binstub installed as ``foobar``, it will default to ``Foobar``.

:param str binary:
    Descriptive lowercase binary name string used in help text.

    For example, Invoke's own internal value for this is ``inv[oke]``,
    denoting that it is installed as both ``inv`` and ``invoke``. As
    this is purely text intended for help display, it may be in any
    format you wish, though it should match whatever you've put into
    your ``setup.py``'s ``console_scripts`` entry.

    If ``None`` (default), uses the first word in ``argv`` verbatim (as
    with ``name`` above, except not capitalized).

:param binary_names:
    List of binary name strings, for use in completion scripts.

    This list ensures that the shell completion scripts generated by
    :option:`--print-completion-script` instruct the shell to use
    that completion for all of this program's installed names.

    For example, Invoke's internal default for this is ``["inv",
    "invoke"]``.

    If ``None`` (the default), the first word in ``argv`` (in the
    invocation of :option:`--print-completion-script`) is used in a
    single-item list.

:param loader_class:
    The `.Loader` subclass to use when loading task collections.

    Defaults to `.FilesystemLoader`.

:param executor_class:
    The `.Executor` subclass to use when executing tasks.

    Defaults to `.Executor`; may also be overridden at runtime by the
    :ref:`configuration system <default-values>` and its
    ``tasks.executor_class`` setting (anytime that setting is not
    ``None``).

:param config_class:
    The `.Config` subclass to use for the base config object.

    Defaults to `.Config`.

.. versionchanged:: 1.2
    Added the ``binary_names`` argument.
NÚunknown)rE   r`   Ú_nameÚ_binaryÚ_binary_namesr[   r   rc   r   rd   r   re   )	rN   rE   r`   ra   rb   rc   rd   re   rf   s	            rO   Ú__init__ÚProgram.__init__¾   sX   € ðj %,¡O‘y¸ˆŒØ"ŒØŒ
ð ŒØ)ÔØˆŒ	Ø(×<Ô,<ˆÔØ,×8´ˆÔØ(×2¬FˆÕrR   c                 ó.   • U R                  5       U l        g)ak  
Instantiate a `.Config` (or subclass, depending) for use in task exec.

This Config is fully usable but will lack runtime-derived data like
project & runtime config files, CLI arg overrides, etc. That data is
added later in `update_config`. See `.Config` docstring for lifecycle
details.

:returns: ``None``; sets ``self.config`` instead.

.. versionadded:: 1.0
N)re   r.   rM   s    rO   Úcreate_configÚProgram.create_config  s   € ð ×'Ñ'Ó)ˆ�rR   Úmergec                 ó€  • 0 nU R                   S   R                  (       a  SUS'   U R                   R                  R                  (       a  SUS'   U R                   R                  R                  (       a#  U R                   R                  R                  US'   U R                   R                  R                  (       a  SUS'   U R                   R
                  R                  (       a  SUS'   0 nSU R                   ;   a#  U R                   S   R                  (       a  S	US
'   0 nU R                   S   R                  nU(       a  XTS'   0 nU R                   S   R                  (       a  Sn[        R                  " U5      US'   [        X#XdS9nU R                  R                  US	S9  U R                   R                  R                  n	U	c   [        R                  R                  SS5      n	U R                  R                  U	5        U R                  R                  S	S9  U(       a  U R                  R                  5         gg)a3  
Update the previously instantiated `.Config` with parsed data.

For example, this is how ``--echo`` is able to override the default
config value for ``run.echo``.

:param bool merge:
    Whether to merge at the end, or defer. Primarily useful for
    subclassers. Default: ``True``.

.. versionadded:: 1.0
rG   TÚwarnrC   r8   r4   r2   rV   FÚdeduper'   ÚcommandrB   z&Desired 'sudo.password' config value: Úpassword)ÚrunÚtasksÚsudoÚtimeouts)rq   NÚINVOKE_RUNTIME_CONFIG)ÚargsÚvaluerC   r8   r4   r2   ÚgetpassÚdictr.   Úload_overridesÚosÚenvironÚgetÚset_runtime_pathÚload_runtimerq   )
rN   rq   rw   rx   rz   ru   ry   ÚpromptÚ	overridesÚruntime_paths
             rO   Úupdate_configÚProgram.update_config.  s®  € ð& ˆØ�9‰9�[Ñ!×'×'ØˆC�‰KØ�9‰9�=‰=××ØˆC�‰JØ�9‰9�>‰>××ØŸ)™)Ÿ.™.×.Ñ.ˆC�‰KØ�9‰9�>‰>××ØˆC�‰KØ�9‰9�=‰=××ØˆC�‰JØˆØ˜$Ÿ)™)Ó#¨¯	©	°+Ñ(>×(D×(DØ#ˆE�(‰OØˆØ—)‘)Ð-Ñ.×4Ñ4ˆÞØ")�YÑð ˆØ�9‰9Ð/Ñ0×6×6Ø=ˆFÜ&Ÿš¨vÓ6ˆD�ÑÜ˜S°DÑLˆ	Ø�‰×"Ñ" 9°EÐ"Ñ:Ø—y‘y×'Ñ'×-Ñ-ˆØÑÜŸ:™:Ÿ>™>Ð*AÀ4ÓHˆLØ�‰×$Ñ$ \Ô2Ø�‰× Ñ  uÐ Ñ-ÞØ�K‰K×ÑÕð rR   Úexitc                 óD  •  U R                  5         U R                  U5        U R                  5         U R                  5         U R	                  5         U R                  5         U R                  5         g! [        [        [        4 Gat  n[        SR                  U5      5        [        U[        5      (       a  [        U[        R                  S9  [        U[        5      (       a3  UR                   (       a"  [        UR                   [        R                  S9  [        U[        5      (       a4  UR"                  R$                  (       a  [        U[        R                  SS9  U(       a€  [        U[        5      (       a  UR"                  R&                  nO9[        U[        5      (       a  UR(                  nO[        U[        5      (       a  Sn[        R*                  " W5         SnAg[        S5         SnAgSnAf[,         a    [        R*                  " S5         gf = f)aP  
Execute main CLI logic, based on ``argv``.

:param argv:
    The arguments to execute against. May be ``None``, a list of
    strings, or a string. See `.normalize_argv` for details.

:param bool exit:
    When ``False`` (default: ``True``), will ignore `.ParseError`,
    `.Exit` and `.Failure` exceptions, which otherwise trigger calls to
    `sys.exit`.

    .. note::
        This is mostly a concession to testing. If you're setting this
        to ``False`` in a production setting, you should probably be
        using `.Executor` and friends directly instead!

.. versionadded:: 1.0
z-Received a possibly-skippable exception: {!r})ÚfilerA   )r�   Úendr   z3Invoked as run(..., exit=False), ignoring exceptionN)ro   Ú
parse_coreÚparse_collectionÚparse_tasksÚparse_cleanupr‰   Úexecuter   r   r   r   ÚformatÚ
isinstanceÚprintÚsysÚstderrÚmessageÚresultr8   ÚexitedÚcoder‹   ÚKeyboardInterrupt)rN   r[   r‹   r5   rœ   s        rO   rw   ÚProgram.runc  sf  € ð(/	ð ×ÑÔ ð �O‰O˜DÔ!à×!Ñ!Ô#à×ÑÔà×ÑÔ ð ×ÑÔ ð �L‰L�NøÜ¤¤jÐ1ô 	MÜÐA×HÑHÈÓKÔLô ˜!œZ×(Ñ(Ü�aœcŸj™jÒ)Ü˜!œT×"Ñ" q§y§yÜ�a—i‘i¤c§j¡jÒ1Ü˜!œ^×,Ñ,°·±··Ü�aœcŸj™j¨bÒ1æÜ˜a¤×0Ñ0ØŸ8™8Ÿ?™?‘DÜ ¤4×(Ñ(ØŸ6™6‘DÜ ¤:×.Ñ.Ø�DÜ—’˜—‘äÐK×LÑLûÜ ó 	Ü�HŠH�QŽKð	ús%   ‚A1A4 Á4HÂ
EG9Ç)G9Ç9#HÈHc                 óf  • [        SR                  U5      5        U R                  U5        U R                  5         [        S5        U R                  S   R
                  (       + [        l        U R                  R                   R
                  (       a
  [        5         U R                  R                  R
                  (       a!  [        S5        U R                  5         [        eU R                  S   R
                  (       a1  [        U R                  S   R
                  U R                  S9  [        eg )Nzargv given to Program.run: {!r}zFinished parsing core argsrI   z)Saw --version, printing version & exitingr@   )Úshellr)   )r   r”   Únormalize_argvÚparse_core_argsr|   r}   r—   Údont_write_bytecoder   rE   Úprint_versionr   r   rf   ©rN   r[   s     rO   r�   ÚProgram.parse_core¨  sä   € ÜÐ/×6Ñ6°tÓ<Ô=Ø×Ñ˜DÔ!ð 	×ÑÔÜÐ*Ô+ð '+§i¡i°Ñ&<×&BÑ&BÔ"BŒÔð �9‰9�?‰?× × ÜÔð �9‰9×Ñ×"×"ÜÐ=Ô>Ø×ÑÔ ÜˆJð �9‰9Ð.Ñ/×5×5Ü#Ø—i‘iÐ 9Ñ:×@Ñ@Ø×'Ñ'òô ˆJð 6rR   c                 ób  • U R                   b  [        S5        U R                   U l        O_[        S5        U R                  R                  R
                  SL a!  [        S5        U R                  5         [        eU R                  5         SU l	        SU l
        SU l        U R                  U l        g)zH
Load a tasks collection & project-level config.

.. versionadded:: 1.0
Nz;Program was given default namespace, not loading collectionz;No default namespace provided, trying to load one from diskTz8No bundled namespace & bare --help given; printing help.r?   )r`   r   rT   r|   r+   r}   Ú
print_helpr   Úload_collectionÚ	list_rootÚ
list_depthÚlist_formatÚscoped_collectionrM   s    rO   r�   ÚProgram.parse_collectionÆ  s•   € ð �>‰>Ñ%ÜØMôð #Ÿn™nˆD�OäØMôð �y‰y�~‰~×#Ñ# tÒ+ÜØNôð —‘Ô!Ü�
Ø× Ñ Ô"ð )-ˆŒØ)-ˆŒØ!ˆÔØ!%§¡ˆÕrR   c                 óX  • U R                   R                  R                  nUSL a!  [        S5        U R	                  5         [
        eU(       aW  XR                  R                  ;   a$  Sn[        U5        U R                  U5        [
        e[        SR                  U5      5      eU R                   R                  R                  nU R                   S   R                  U l        U R                   S   R                  U l        U(       aS  [        U[        5      (       a(  X0l         U R"                  R%                  U5      nX@l        U R+                  5         [
        eU R                   R,                  R                  (       aC  [-        U R.                  U R0                  U R2                  U R"                  U R5                  5       S9  U R6                  (       d-  U R"                  R8                  (       d  U R;                  5         g	g	g	! [(         a    Sn[        UR                  U5      5      ef = f)
zW
Post-parsing, pre-execution steps such as --help, --list, etc.

.. versionadded:: 1.0
Tz(Saw bare --help, printing help & exitingz7Saw --help <taskname>, printing per-task help & exitingzNo idea what '{}' is!r=   r;   zSub-collection '{}' not found!)r)   r$   Úinitial_contextrT   ÚparserN)r|   r+   r}   r   r¨   r   r±   ÚcontextsÚprint_task_helpr   r”   r9   r¬   r«   r•   rL   rª   rT   Úsubcollection_from_pathr­   ÚKeyErrorÚ
list_tasksr   rf   r$   r°   Ú_make_parserrx   r-   Úno_tasks_given)rN   ÚhalpÚmsgrª   Úsubs        rO   r’   ÚProgram.parse_cleanupê  s©  € ð �y‰y�~‰~×#Ñ#ˆð �4Š<ÜÐ<Ô=Ø�O‰OÔÜˆJö Ø—{‘{×+Ñ+Ó+ØO�Ü�c”
Ø×$Ñ$ TÔ*Ü�
ô !Ð!8×!?Ñ!?ÀÓ!EÓFÐFð —I‘I—N‘N×(Ñ(ˆ	ØŸ9™9 ]Ñ3×9Ñ9ˆÔØŸ)™) LÑ1×7Ñ7ˆŒÞä˜)¤S×)Ñ)Ø!*”ð6ØŸ/™/×AÑAÀ)ÓL�CØ-0Ô*ð �O‰OÔÜˆJð �9‰9×Ñ×#×#ÜØ×'Ñ'Ø—Y‘YØ $× 4Ñ 4ØŸ?™?ð ×(Ñ(Ó*òð �z�z $§/¡/×"9×"9Ø×ÑÕ!ð #:ˆzøô-  ó 6Ø:�CÜ˜sŸz™z¨)Ó4Ó5Ð5ð6ús   Ä$!H È'H)c                 óD   • [        S5        U R                  5         [        e)NzVNo tasks specified for execution and no default task; printing global help as fallback)r   r¨   r   rM   s    rO   r¸   ÚProgram.no_tasks_given(  s   € ÜØdô	
ð 	�‰ÔÜˆ
rR   c                 ó8  • U R                   nU R                  R                  R                   nUb*  UR                  S5      u  p4n[	        U5      n[        Xe5      nU" U R                  U R                  U R                  5      nUR                  " U R                  6   g)a~  
Hand off data & tasks-to-execute specification to an `.Executor`.

.. note::
    Client code just wanting a different `.Executor` subclass can just
    set ``executor_class`` in `.__init__`, or override
    ``tasks.executor_class`` anywhere in the :ref:`config system
    <default-values>` (which may allow you to avoid using a custom
    Program entirely).

.. versionadded:: 1.0
NÚ.)	rd   r.   rx   Ú
rpartitionr   ÚgetattrrT   r$   r“   )rN   ÚklassÚconfig_pathÚmodule_pathÚ_Ú
class_nameÚmoduleÚexecutors           rO   r“   ÚProgram.execute/  s�   € ð ×#Ñ#ˆØ—k‘k×'Ñ'×6Ñ6ˆØÑ"à)4×)?Ñ)?ÀÓ)DÑ&ˆK˜Jô # ;Ó/ˆFÜ˜FÓ/ˆEÙ˜Ÿ™¨$¯+©+°t·y±yÓAˆØ×Ò˜$Ÿ*™*Ò%rR   c                 óê   • Uc+  [         R                  n[        SR                  U5      5        O?[	        U[
        5      (       a*  UR                  5       n[        SR                  U5      5        Xl        g)aa  
Massages ``argv`` into a useful list of strings.

**If None** (the default), uses `sys.argv`.

**If a non-string iterable**, uses that in place of `sys.argv`.

**If a string**, performs a `str.split` and then executes with the
result. (This is mostly a convenience; when in doubt, use a list.)

Sets ``self.argv`` to the result.

.. versionadded:: 1.0
Nz#argv was None; using sys.argv: {!r}z%argv was string-like; splitting: {!r})r—   r[   r   r”   r•   rL   Úsplitr¥   s     rO   r¡   ÚProgram.normalize_argvI  sW   € ð ‰<Ü—8‘8ˆDÜÐ7×>Ñ>¸tÓDÕEÜ˜œc×"Ñ"Ø—:‘:“<ˆDÜÐ9×@Ñ@ÀÓFÔGØ�	rR   c                 ó\   • U R                   =(       d    U R                  R                  5       $ )zQ
Derive program's human-readable name based on `.binary`.

.. versionadded:: 1.0
)ri   rb   Ú
capitalizerM   s    rO   ra   ÚProgram.name`  s    € ð �z‰z×5˜TŸ[™[×3Ñ3Ó5Ð5rR   c                 ó€   • U R                   (       a,  [        R                  R                  U R                   S   5      $ S$ )zÊ
Returns the program name we were actually called as.

Specifically, this is the (Python's os module's concept of a) basename
of the first argument in the parsed argument vector.

.. versionadded:: 1.2
r   rA   )r[   r�   ÚpathÚbasenamerM   s    rO   Ú	called_asÚProgram.called_asi  s,   € ð 26··Œr�w‰w×Ñ §	¡	¨!¡Ó-ÐBÀÐBrR   c                 ó@   • U R                   =(       d    U R                  $ )z]
Derive program's help-oriented binary name(s) from init args & argv.

.. versionadded:: 1.0
)rj   rÔ   rM   s    rO   rb   ÚProgram.binaryv  s   € ð �|‰|×-˜tŸ~™~Ð-rR   c                 óB   • U R                   =(       d    U R                  /$ )z^
Derive program's completion-oriented binary name(s) from args & argv.

.. versionadded:: 1.2
)rk   rÔ   rM   s    rO   rf   ÚProgram.binary_names  s   € ð ×!Ñ!×5 d§n¡nÐ%5Ð5rR   c                 ó4   • U R                   S   R                  $ )zR
Obtain core program args from ``self.core`` parse result.

.. versionadded:: 1.0
r   )r$   r|   rM   s    rO   r|   ÚProgram.args‰  s   € ð �y‰y˜‰|× Ñ Ð rR   c                 ór   • U R                  5       nU R                  c  XR                  5       -  n[        US9$ )zÉ
The initial parser context, aka core program flags.

The specific arguments contained therein will differ depending on
whether a bundled namespace was specified in `.__init__`.

.. versionadded:: 1.0
)r|   )rP   r`   rY   r   )rN   r|   s     rO   r°   ÚProgram.initial_context’  s4   € ð �~‰~ÓˆØ�>‰>Ñ!Ø—N‘NÓ$Ñ$ˆDÜ $Ñ'Ð'rR   c                 ót   • [        SR                  U R                  U R                  =(       d    S5      5        g )Nú{} {}rh   )r–   r”   ra   rE   rM   s    rO   r¤   ÚProgram.print_version¡  s"   € Üˆg�n‰n˜TŸY™Y¨¯©×(A¸	ÓBÕCrR   c                 ó@  • SnU R                   b  Sn[        SR                  U R                  U5      5        [        S5        [        S5        [        S5        U R	                  U R
                  R                  5       5        U R                   b  U R                  5         g g )Nz-task1 [--task1-opts] ... taskN [--taskN-opts]z$<subcommand> [--subcommand-opts] ...zUsage: {} [--core-opts] {}rA   zCore options:)r`   r–   r”   rb   Úprint_columnsr°   Úhelp_tuplesr¶   )rN   Úusage_suffixs     rO   r¨   ÚProgram.print_help¤  s|   € ØFˆØ�>‰>Ñ%ØAˆLÜÐ*×1Ñ1°$·+±+¸|ÓLÔMÜˆbŒ	ÜˆoÔÜˆbŒ	Ø×Ñ˜4×/Ñ/×;Ñ;Ó=Ô>Ø�>‰>Ñ%Ø�O‰OÕð &rR   c                 óþ   • [        S5        [        U R                  SS9nUR                  U R                  SS 5      U l        Sn[        UR                  U R
                  U R
                  R                  5      5        g)z“
Filter out core args, leaving any tasks or their args for later.

Sets ``self.core`` to the `.ParseResult` from this step.

.. versionadded:: 1.0
z#Parsing initial context (core args)T)ÚinitialÚignore_unknownr   Nz-Core-args parse result: {!r} & unparsed: {!r})r   r   r°   Ú
parse_argvr[   r$   r”   Úunparsed)rN   r±   rº   s      rO   r¢   ÚProgram.parse_core_args°  sa   € ô 	Ð3Ô4Ü × 4Ñ 4ÀTÑJˆØ×%Ñ% d§i¡i°° mÓ4ˆŒ	Ø=ˆÜˆc�j‰j˜Ÿ™ D§I¡I×$6Ñ$6Ó7Õ8rR   c                 ó  • U R                   S   R                  nU R                  U R                  US9nU R                   R                  R                  n UR                  U5      u  pEU R                  R                  U5        U R                  R                  5         [        R                  " UUU R                  R                  R                  S9U l        g! [         a)  n[        SR                  UR                  5      5      eSnAff = f)zY
Load a task collection based on parsed core args, or die trying.

.. versionadded:: 1.0
rW   )r.   Ústart)Úloaded_fromÚauto_dash_namesz%Can't find any collection named {!r}!N)r|   r}   rc   r.   rT   ÚloadÚset_project_locationÚload_projectr   Úfrom_modulerx   rï   r   r   r”   ra   )rN   rí   ÚloaderÚ	coll_namerÈ   Úparentr5   s          rO   r©   ÚProgram.load_collection¾  sá   € ð —	‘	˜-Ñ(×.Ñ.ˆØ×"Ñ"Ø—;‘; eð #ð 
ˆð —I‘I×(Ñ(×.Ñ.ˆ	ð	OØ#Ÿ[™[¨Ó3‰NˆFð
 �K‰K×,Ñ,¨VÔ4Ø�K‰K×$Ñ$Ô&Ü(×4Ò4ØØ"Ø $§¡× 1Ñ 1× AÑ AñˆD�Oøô
 "ó 	OÜÐ>×EÑEÀaÇfÁfÓMÓNÐNûð	Oús   ÁBC Ã
D
Ã!$DÄD
ÚcontextÚnew_argsc                 ó˜   • UR                  5        H6  u  p4UR                  (       d  M  UR                  UR                  U   l        M8     g ©N)ÚitemsÚ	got_valueÚ_valuer|   )rN   rø   rù   ÚkeyÚargs        rO   Ú_update_core_contextÚProgram._update_core_contextÛ  s5   € ð !Ÿ™Ö(‰HˆCØ�}�}‰}Ø+.¯:©:�—‘˜SÑ!Ö(ò )rR   c                 ó”   • [        U R                  U R                  R                  U R                  R
                  R                  S9S9$ )N)Úignore_unknown_help)rç   r²   )r   r°   rT   Úto_contextsr.   rx   r  rM   s    rO   r·   ÚProgram._make_parseræ  sB   € ÜØ×(Ñ(Ø—_‘_×0Ñ0Ø$(§K¡K×$5Ñ$5×$IÑ$Ið 1ð ñ
ð 	
rR   c                 ó¶  • U R                  5       U l        [        SR                  U R                  5      5        U R                  R                  U R                  R                  5      nUR                  S5      U l	        U R                  U R                  S   U R                  R                  S9  Xl        [        SR                  U R                  5      5        g)aµ  
Parse leftover args, which are typically tasks & per-task args.

Sets ``self.parser`` to the parser used, ``self.tasks`` to the
parsed per-task contexts, and ``self.core_via_tasks`` to a context
holding any core flags seen within the task contexts.

Also modifies ``self.core`` to include the data from ``core_via_tasks``
(so that it correctly reflects any supplied core flags regardless of
where they appeared).

.. versionadded:: 1.0
zParsing tasks against {!r}r   )rø   rù   zResulting task contexts: {!r}N)r·   r±   r   r”   rT   ré   r$   rê   ÚpopÚcore_via_tasksr  r|   rx   )rN   rš   s     rO   r‘   ÚProgram.parse_tasksî  s¥   € ð ×'Ñ'Ó)ˆŒÜÐ*×1Ñ1°$·/±/ÓBÔCØ—‘×'Ñ'¨¯	©	×(:Ñ(:Ó;ˆØ$Ÿj™j¨›mˆÔØ×!Ñ!Ø—I‘I˜a‘L¨4×+>Ñ+>×+CÑ+Cð 	"ñ 	
ð Œ
ÜÐ-×4Ñ4°T·Z±ZÓ@ÕArR   c                 óÈ  • U R                   R                  U   nUR                  5       n[        R                  " U R
                  U   5      nSnU(       a  SOSn[        UR                  U R                  X5      5        [        S5        [        S5        U(       a]  UR                  5        H=  nUR                  5       (       a  [        U R                  U-   5        M2  [        S5        M?     [        S5        O#[        U R                  S-   5        [        S5        [        S5        U(       a  U R                  U5        g[        U R                  S-   5        [        S5        g)zX
Print help for a specific task, e.g. ``inv --help <taskname>``.

.. versionadded:: 1.0
z3Usage: {} [--core-opts] {} {}[other tasks here ...]z[--options] rA   z
Docstring:ÚnonezOptions:N)r±   r²   rã   ÚinspectÚgetdocrT   r–   r”   rb   Ú
splitlinesÚstripÚleading_indentrâ   )rN   ra   ÚctxÚtuplesÚ	docstringÚheaderÚoptsÚlines           rO   r³   ÚProgram.print_task_help  s   € ð �k‰k×"Ñ" 4Ñ(ˆØ—‘Ó"ˆÜ—N’N 4§?¡?°4Ñ#8Ó9ˆ	ØFˆÞ!'‰~¨RˆÜˆf�m‰m˜DŸK™K¨Ó4Ô5ÜˆbŒ	ÜˆlÔÞà!×,Ñ,Ö.�Ø—:‘:—<‘<Ü˜$×-Ñ-°Ñ4Ö5ä˜"–Iñ	 /ô
 �"�Iä�$×%Ñ%¨Ñ.Ô/Ü�"ŒIÜˆjÔÞØ×Ñ˜vÕ&ä�$×%Ñ%¨Ñ.Ô/Ü�"�IrR   c                 óÊ   • U R                   nU(       d&  Sn[        UR                  UR                  5      5      e[	        U SR                  U R
                  5      5      " 5         g )Nz"No tasks found in collection '{}'!zlist_{})r­   r   r”   ra   rÂ   r¬   )rN   Úfocusrº   s      rO   r¶   ÚProgram.list_tasks'  sM   € à×&Ñ&ˆÞØ6ˆCÜ�s—z‘z %§*¡*Ó-Ó.Ð.ô 	��i×&Ñ& t×'7Ñ'7Ó8Ô9Õ;rR   c                 óX   • U R                  U R                  5      nU R                  US9  g )N)Úpairs©Ú_make_pairsr­   Údisplay_with_columns)rN   r  s     rO   Ú	list_flatÚProgram.list_flat1  s)   € Ø× Ñ  ×!7Ñ!7Ó8ˆØ×!Ñ!¨Ð!Ò.rR   c                 ó\   • U R                  U R                  5      nSnU R                  XS9  g )Nz'*' denotes collection defaults)r  Úextrar  )rN   r  r$  s      rO   Úlist_nestedÚProgram.list_nested5  s.   € Ø× Ñ  ×!7Ñ!7Ó8ˆØ1ˆØ×!Ñ!¨Ð!Ò;rR   ÚcollÚ	ancestorsc                 óº  • Uc  / n/ n[        U5      U R                  -  nSR                  S U 5       5      n[        UR                  R                  5       5       GH`  u  pgXaR                  :H  nUn	[        [        UR                  [        UR                  5      5      5      n
U(       d  U R                  (       a2  SR                  U	5      n	U
 Vs/ s H  nSR                  U5      PM     n
nU R                  S:X  a  UnU(       a  U	S-  n	U R                  S:X  aS  UnU(       a  U R                  (       a  SU-   nU
 Vs/ s H  oÜU-   PM	     n
nU(       a  U(       a  U
R                  SU5        U
(       a   SR                  S	R                  U
5      5      OS
nWU	-   U-   nUR                  U[!        U5      45        GMc     U R"                  =(       a    [        U5      S-   U R"                  :¬  n[        UR$                  R                  5       5       GH6  u  nnUn	U(       d  U R                  (       a  SR                  U	5      n	U(       ak  S Vs/ s H;  n['        UU5      (       d  M  SR                  [        ['        UU5      5      U5      PM=     nnU	SR                  S	R                  U5      5      -  n	U R                  S:X  a  UR                  XI-   [!        U5      45        O5U R                  S:X  a%  U(       a  UR                  XY-   [!        U5      45        U(       a  GM  U R)                  UX&/-   S9nUR+                  U5        GM9     U$ s  snf s  snf s  snf )NrÀ   c              3   ó$   #   • U  H  ov •  M     g 7frû   © ©Ú.0Úxs     rO   Ú	<genexpr>Ú&Program._make_pairs.<locals>.<genexpr>C  s   é € Ð 6ªI q¤ªIùs   ‚ú.{}ÚnestedÚ*r?   r   z ({})z, rA   r   )rx   Úcollectionsrß   z [{}])r'  r(  )ÚlenÚindentÚjoinÚsortedrx   rü   r-   r9   ÚmapÚ	transformÚaliasesrª   r”   r¬   ÚinsertÚappendr   r«   r4  rÂ   r  Úextend)rN   r'  r(  r  r6  Úancestor_pathra   ÚtaskÚ
is_defaultÚdisplaynamer;  r.  ÚprefixÚaliasÚ	alias_strÚfullÚtruncateÚsubcollÚattrÚtalliesÚrecursed_pairss                        rO   r  ÚProgram._make_pairs:  sÒ  € ð
 ÑØˆIØˆÜ�Y“ $§+¡+Ñ-ˆØŸ™Ñ 6©IÓ 6Ó6ˆÜ  §¡×!1Ñ!1Ó!3×4‰JˆDØ§¡Ñ-ˆJð ˆKÜœ3˜tŸ~™~¬v°d·l±lÓ/CÓDÓEˆGö ˜DŸNŸNØ#Ÿl™l¨;Ó7�Ù4;Ó<²G¨q˜5Ÿ<™<¨ž?±G�Ð<à×Ñ 8Ó+Ø�ÞØ 3Ñ&�Kð ×Ñ 6Ó)Ø&�ö ˜dŸnŸnØ  6™\�FÙ7>Ó?²w¨e Eœ>±w�Ð?Þ¦)Ø—N‘N 1 fÔ-æ>E˜Ÿ™ t§y¡y°Ó'9Ô:È2ˆIØ˜KÑ'¨)Ñ3ˆDØ�L‰L˜$¤¨£Ð/×0ñA 5ðD —?‘?×N¬¨I«¸Ñ(:¸t¿¹Ñ'NˆÜ# D×$4Ñ$4×$:Ñ$:Ó$<×=‰MˆD�'ØˆKÞ˜DŸNŸNØ#Ÿl™l¨;Ó7�Þñ !9óâ 8˜Ü˜w¨×-ó F�G—N‘N¤3¤w¨w¸Ó'=Ó#>ÀÖEÙ 8ð ð ð
 ˜wŸ~™~¨d¯i©i¸Ó.@ÓAÑA�Ø×Ñ 8Ó+Ø—‘˜fÑ2´H¸WÓ4EÐFÕGØ×!Ñ! VÓ+¶à—‘˜mÑ9¼8ÀGÓ;LÐMÔNç‘8Ø!%×!1Ñ!1Ø ¨I¸Ñ,>ð "2ð "�ð —‘˜^×,ñ+ >ð, ˆùò] =ùò @ùòs   ÃMÄ>MÉMÉ')Mc                 ó²   • U R                   (       a  [        S5      eU R                  nUR                  5       n[	        [
        R                  " U5      5        g )Nz:The --list-depth option is not supported with JSON format!)r«   r   r­   Ú
serializedr–   ÚjsonÚdumps)rN   r'  Údatas      rO   Ú	list_jsonÚProgram.list_json  sE   € ð
 �?�?ÜØLóð ð ×%Ñ%ˆØ�‰Ó ˆÜŒd�jŠj˜ÓÕrR   r$  c                 óF  • U R                   nU R                  nU(       a  SR                  U5      OSnSnU(       d  U(       a>  U(       a  SR                  U5      OSnU(       a	  U(       a  SOSnSR                  XgU5      nSR                  XE5      nU R                  b  SnU$ )Nú '{}'rA   zdepth={}z; z	 ({}{}{})zAvailable{} tasks{}ÚSubcommands)rª   r«   r”   r`   )	rN   r$  ÚrootÚdepthÚ	specifierÚtailÚdepthstrÚjoinerÚtexts	            rO   Útask_list_openerÚProgram.task_list_opener�  s‡   € Ø�~‰~ˆØ—‘ˆÞ,0�G—N‘N 4Ô(°bˆ	ØˆÞ–EÞ38�z×(Ñ(¨Ô/¸bˆHÞ#®‘T°BˆFØ×%Ñ% h¸Ó>ˆDØ$×+Ñ+¨IÓ<ˆð �>‰>Ñ%Ø ˆDØˆrR   r  c                 óR  • U R                   n[        SR                  U R                  US95      5        U R	                  U5        U R
                  R                  nU(       aF  SnU(       a"  SR                  U5      nSR                  U5      n[        SR                  XT5      5        g g )Nz{}:
)r$  rA   rU  r1  zDefault{} task: {}
)rª   r–   r”   r^  râ   r­   r-   )rN   r  r$  rW  r-   Úspecifics         rO   r   ÚProgram.display_with_columnsŸ  s�   € ð �~‰~ˆÜˆg�n‰n˜T×2Ñ2¸Ð2Ð?Ó@ÔAØ×Ñ˜5Ô!ð ×(Ñ(×0Ñ0ˆÞØˆHÞØ"Ÿ>™>¨$Ó/�ØŸ,™, wÓ/�äÐ(×/Ñ/°ÓBÕCð rR   r  c                 ó,  • [        S U 5       5      n[        5       S   U-
  U R                  -
  U R                  -
  S-
  n[        R
                  " US9nU H°  u  pVUc  SnUR                  U5      nU[        U5      -
  nSR                  U R                  UUS-  U R                  S-  45      n	U(       a8  [        X—S   -   5        USS  H  n
[        S[        U	5      -  U
-   5        M     M—  [        U	R                  5       5        M²     [        S5        g)zŽ
Print tabbed columns from (name, help) ``tuples``.

Useful for listing tasks + docstrings, flags + help strings, etc.

.. versionadded:: 1.0
c              3   ó>   #   • U  H  n[        US    5      v •  M     g7f)r   N)r5  r,  s     rO   r/  Ú(Program.print_columns.<locals>.<genexpr>¼  s   é € Ð3ªF qœ˜Q˜q™TŸ˜ªFùs   ‚r   r   )ÚwidthNrA   r]   )Úmaxr   Úleading_indent_widthÚcol_paddingÚtextwrapÚTextWrapperÚwrapr5  r7  r  r–   Úrstrip)rN   r  Ú
name_widthÚ
desc_widthÚwrapperra   Úhelp_strÚhelp_chunksÚname_paddingÚspecÚchunks              rO   râ   ÚProgram.print_columns°  s  € ô Ñ3©FÓ3Ó3ˆ
ä‹J�q‰MØñà×'Ñ'ñ(ð ×Ññð ñ	ð 	ô ×&Ò&¨ZÑ8ˆÛ$‰NˆDØÑØ�à!Ÿ,™, xÓ0ˆKà%¬¨D«	Ñ1ˆLØ—7‘7à×'Ñ'ØØ  3Ñ&Ø×$Ñ$ sÑ*ð	óˆDö Ü�d¨™^Ñ+Ô,Ø(¨¨›_�EÜ˜3¤ T£™?¨eÑ3Ö4ó -ô �d—k‘k“mÖ$ñ+ %ô, 	ˆb�	rR   )rj   rk   ri   r[   rT   r.   re   r$   r	  rd   r«   r¬   rª   rc   r`   r±   r­   rx   rE   )NNNNNNNN)r%   N)T)NT)r%   r    rû   )rA   ):Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r   rP   rY   rL   rh  r  Úindent_widthr6  ri  r   r   rl   ro   rK   r‰   rw   r�   r�   r’   r¸   r“   r¡   Úpropertyra   rÔ   rb   rf   r|   r   r°   r¤   r¨   r¢   r©   r   r   r  r   r·   r‘   r³   r¶   r!  r%  r
   r  rR  r^  r	   r   râ   Ú__static_attributes__r+  rR   rO   r"   r"       s�  ‡ ñð Óðf
˜4 
Ñ+ô f
ðP
˜4 
Ñ+ô 
ð: ˆs‰)ƒOð ÐØÐ/Ñ/€NØ€LØ�<Ñ€FØ€Kð "&Ø,0Ø"Ø $Ø15Ø59Ø15Ø,0ñ_3à˜#‘ð_3ð ˜LÑ)ð_3ð �s‰mð	_3ð
 ˜‘ð_3ð ˜t H™~Ñ.ð_3ð !  jÑ!1Ñ2ð_3ð ˜t H™~Ñ.ð_3ð ˜t C™yÑ)ð_3ð 
õ_3ôB*ñ3  4ð 3 °4õ 3 ñjC˜  c¡Ñ+ð C¸$ð CÈ$õ CðJ˜x¨¨S©	Ñ2ð °tô ô< 1ôH<"ô|ô&ð4 8¨D°©IÑ#6ð ¸4ô ð. ð6�có 6ó ð6ð ð
C˜3ó 
Có ð
Cð ð.˜ó .ó ð.ð ð6˜d 3™ió 6ó ð6ð ó!ó ð!ð ð( ó (ó ð(ôDô
ô9ôOð:	6Ø$ð	6Ø04°S¸#°X±ð	6à	ô	6ð
˜fô 
ôBð0 Cð ¨Dô ôB<ô/ô<ð *.ñCàðCð ˜D ™IÑ&ðCð 
ˆe�C˜ #™Ð&Ñ'Ñ	(õ	CôJ ñ  cð °3õ ð" HJñDØ˜e C¨°#©Ð$6Ñ7Ñ8ðDØADðDà	õDð"+Ø˜u S¨(°3©-Ð%7Ñ8Ñ9ð+à	÷+rR   r"   )-r~   r  rO  r�   r—   rj  Ú	importlibr   Útypingr   r   r   r   r   r	   r
   r   rA   r   r   r   r   Úcompletion.completer   r   Ú
exceptionsr   r   r   r   r±   r   r   r   Ú	terminalsr   Úutilr   r   r   rô   r   r   r    r"   r+  rR   rO   Ú<module>r†     sa   ðÛ Û Û Û 	Û 
Û Ý #÷	÷ 	ó 	÷ =Ó <ß Bß LÓ Lß 3Ñ 3Ý ß 1Ñ 1æÝÝ#Ý÷{ò {rR   