zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
U
ß=®d¦½ã@sHddlZddlZddlZddlZddlZddlZddlmZddl    m
Z
ddl    m Z ddl m Z ddlmZddlmZddlmZdd    lmZd
d lmZd
d lmZd
d lmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dl m!Z!d
dl m"Z"d
dl#m$Z$d
dl#m%Z%d
dl#m&Z&d
dl'm(Z(d
dl'm)Z)d
dl'm*Z*d
dl+m,Z,d
dl+m-Z-d
dl+m.Z.d
dl+m/Z/d
d l+m0Z0d
d!l+m1Z1ej2rÀddl3Z4d
d"l5m6Z6ej7d#ej8d$ej9fd%Z:e 7d&¡Z;d'e<ej=ej>e<d(fd)œd*d+„Z?dNd-e<d(e@dd.œd/d0„ZAejBe;eCejDej>e;d$fd1œd2d3„ZEe
dOd'ejFd4ej=dd5œd6d7„ƒZGejHd4ejHd4ejDd4d8œd9d:„ZIGd;d<„d<ejJƒZKGd=d'„d'ƒZLGd>d?„d?ƒZMGd@d(„d(eMƒZNGdAd-„d-eNƒZOGdBdC„dCeOƒZPGdDdE„dEeOƒZQej9ej=ej9dFœdGdH„ZRGdId4„d4ƒZSGdJdK„dKeSƒZTGdLdM„dMeSƒZUdS)PéN)Úabc)Úcontextmanager)Ú    ExitStack)Úupdate_wrapper)Úgettext)Úngettext)Úrepeat)Ú TracebackTypeé)Útypes©ÚAbort)Ú BadParameter)ÚClickException©ÚExit)ÚMissingParameter©Ú
UsageError)Ú HelpFormatter)Ú join_options)Ú pop_context)Ú push_context©Ú_flag_needs_value)Ú OptionParser)Ú    split_opt)Úconfirm)Úprompt)Ústyle)Ú_detect_program_name)Ú _expand_args)Úecho)Úmake_default_short_help)Úmake_str)ÚPacifyFlushWrapper©ÚCompletionItemÚF.)ÚboundÚVÚContextÚCommand©ÚctxÚ
incompleteÚreturnccsPt t|j¡}| |¡D]2}| |¡r| ||¡}|dk    r|js||fVqdS)zÓList all the subcommands of a group that start with the
    incomplete value and aren't hidden.
 
    :param ctx: Invocation context for the group.
    :param incomplete: Value being completed. May be empty.
    N)ÚtÚcastÚ MultiCommandÚcommandÚ list_commandsÚ
startswithÚ get_commandÚhidden)r.r/ZmultiÚnamer4©r:úAd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\click/core.pyÚ_complete_visible_commands0s     
 r<Fr3)Ú base_commandÚcmd_nameÚcmdÚregisterr0cCsh|jrt|tƒsdS|rd}nd}t|›d|j›d|›d|›dt|ƒj›dt|ƒj›d|j›d    ƒ‚dS)
NzdIt is not possible to add multi commands as children to another multi command that is in chain mode.zdFound a multi command as subcommand to a multi command that is in chain mode. This is not supported.z
. Command z is set to chain and zA was added as a subcommand but it in itself is a multi command. (z is a z within a chained z named z).)ÚchainÚ
isinstancer3Ú RuntimeErrorr9ÚtypeÚ__name__)r=r>r?r@Úhintr:r:r;Ú_check_multicommandCsÿÿ<ÿrG)ÚiterableÚ
batch_sizer0cCstttt|ƒ|ƒŽƒS©N)ÚlistÚziprÚiter)rHrIr:r:r;Úbatch[srNÚ    Parameter)r.Úparamr0c
csŽz
dVWn~tk
rV}z.|jdkr,||_|dk    rD|jdkrD||_‚W5d}~XYn4tk
rˆ}z|jdkrv||_‚W5d}~XYnXdS)z>Context manager that attaches extra information to exceptions.N)rr.rPr)r.rPÚer:r:r;Úaugment_usage_errors_s
 
 
rR)Úinvocation_orderÚdeclaration_orderr0cs*dtjttfdœ‡fdd„ }t||dS)zÏGiven a sequence of parameters in the order as should be considered
    for processing and an iterable of parameters that exist, this returns
    a list in the correct order as they should be processed.
    rO)Úitemr0cs8zˆ |¡}Wntk
r*tdƒ}YnX|j |fS)NÚinf)ÚindexÚ
ValueErrorÚfloatÚis_eager)rUÚidx©rSr:r;Úsort_key{s
z,iter_params_for_processing.<locals>.sort_key©Úkey)r1ÚTupleÚboolrYÚsorted)rSrTr]r:r\r;Úiter_params_for_processingrs    rcc@s8eZdZdZe ¡Ze ¡Ze ¡Ze ¡Z    e ¡Z
dS)ÚParameterSourcea\This is an :class:`~enum.Enum` that indicates the source of a
    parameter's value.
 
    Use :meth:`click.Context.get_parameter_source` to get the
    source for a parameter by name.
 
    .. versionchanged:: 8.0
        Use :class:`~enum.Enum` and drop the ``validate`` method.
 
    .. versionchanged:: 8.0
        Added the ``PROMPT`` value.
    N) rEÚ
__module__Ú __qualname__Ú__doc__ÚenumÚautoÚ COMMANDLINEÚ ENVIRONMENTÚDEFAULTÚ DEFAULT_MAPÚPROMPTr:r:r:r;rd†s rdc@s~eZdZUdZeZejded<dTdej    dej    e
ej    ej ej    e
ej    ej e
ej fej    e ej    e eej    eej    eej    eej    eje
ej    eje
ge
fej    eej    eddœdd    „Zeje
ej fd
œd d „Zdd
œd d„Zej    ejeej    eej    eddœdd„ZedUeejddœdd„ƒZeeje
ej fd
œdd„ƒZed
œdd„Zejeedœdd„Z ejdej fejdej fdœdd „Z!dd
œd!d"„Z"ee
d
œd#d$„ƒZ#dd
œd%d&„Z$ejeej    ed'œd(d)„Z%ejeed'œd*d+„Z&ej'dVe
d,ej    ej d-œd.d/„ƒZ(ej'dWe
d0ej    ej)ej ejgej ffd-œd1d/„ƒZ(dXe
eej    ej d-œd2d/„Z(e
d3d4œd5d6„Z*d3d
œd7d8„Z+dYe d3d:œd;d<„Z,e
d
œd=d>„Z-e
d
œd?d@„Z.dddAœdBdC„Z/ej'dDej ej edEœdFdG„ƒZ0ej'dej ej ej dEœdHdG„ƒZ0ej)dIej ej ej)ej efdEœdJdG„Z0dej ej ej dKœdLdM„Z1e
e2ddNœdOdP„Z3e
ej    e2dQœdRdS„Z4dS)Zr+aðThe context is a special internal object that holds state relevant
    for the script execution at every single level.  It's normally invisible
    to commands unless they opt-in to getting access to it.
 
    The context is useful as it can pass internal objects around and can
    control special execution features such as reading data from
    environment variables.
 
    A context can be used as context manager in which case it will call
    :meth:`close` on teardown.
 
    :param command: the command class for this context.
    :param parent: the parent context.
    :param info_name: the info name for this invocation.  Generally this
                      is the most descriptive name for the script or
                      command.  For the toplevel script it is usually
                      the name of the script, for commands below it it's
                      the name of the script.
    :param obj: an arbitrary object of user data.
    :param auto_envvar_prefix: the prefix to use for automatic environment
                               variables.  If this is `None` then reading
                               from environment variables is disabled.  This
                               does not affect manually set environment
                               variables which are always read.
    :param default_map: a dictionary (like object) with default values
                        for parameters.
    :param terminal_width: the width of the terminal.  The default is
                           inherit from parent context.  If no context
                           defines the terminal width then auto
                           detection will be applied.
    :param max_content_width: the maximum width for content rendered by
                              Click (this currently only affects help
                              pages).  This defaults to 80 characters if
                              not overridden.  In other words: even if the
                              terminal is larger than that, Click will not
                              format things wider than 80 characters by
                              default.  In addition to that, formatters might
                              add some safety mapping on the right.
    :param resilient_parsing: if this flag is enabled then Click will
                              parse without any interactivity or callback
                              invocation.  Default values will also be
                              ignored.  This is useful for implementing
                              things such as completion support.
    :param allow_extra_args: if this is set to `True` then extra arguments
                             at the end will not raise an error and will be
                             kept on the context.  The default is to inherit
                             from the command.
    :param allow_interspersed_args: if this is set to `False` then options
                                    and arguments cannot be mixed.  The
                                    default is to inherit from the command.
    :param ignore_unknown_options: instructs click to ignore options it does
                                   not know and keeps them for later
                                   processing.
    :param help_option_names: optionally a list of strings that define how
                              the default help parameter is named.  The
                              default is ``['--help']``.
    :param token_normalize_func: an optional function that is used to
                                 normalize tokens (options, choices,
                                 etc.).  This for instance can be used to
                                 implement case insensitive behavior.
    :param color: controls if the terminal supports ANSI colors or not.  The
                  default is autodetection.  This is only needed if ANSI
                  codes are used in texts that Click prints which is by
                  default not the case.  This for instance would affect
                  help output.
    :param show_default: Show the default value for commands. If this
        value is not set, it defaults to the value from the parent
        context. ``Command.show_default`` overrides this default for the
        specific command.
 
    .. versionchanged:: 8.1
        The ``show_default`` parameter is overridden by
        ``Command.show_default``, instead of the other way around.
 
    .. versionchanged:: 8.0
        The ``show_default`` parameter defaults to the value from the
        parent context.
 
    .. versionchanged:: 7.1
       Added the ``show_default`` parameter.
 
    .. versionchanged:: 4.0
        Added the ``color``, ``ignore_unknown_options``, and
        ``max_content_width`` parameters.
 
    .. versionchanged:: 3.0
        Added the ``allow_extra_args`` and ``allow_interspersed_args``
        parameters.
 
    .. versionchanged:: 2.0
        Added the ``resilient_parsing``, ``help_option_names``, and
        ``token_normalize_func`` parameters.
    rÚformatter_classNFr,)r4ÚparentÚ    info_nameÚobjÚauto_envvar_prefixÚ default_mapÚterminal_widthÚmax_content_widthÚresilient_parsingÚallow_extra_argsÚallow_interspersed_argsÚignore_unknown_optionsÚhelp_option_namesÚtoken_normalize_funcÚcolorÚ show_defaultr0cCs(||_||_||_i|_g|_g|_|r2t|jƒntƒ|_|dkrP|dk    rP|j}||_t    |diƒ|_
|dkr’|dk    r’|dk    r’|j dk    r’|j   |¡}||_ d|_ |dkr´|dk    r´|j}||_|dkrÐ|dk    rÐ|j}||_|
dkrä|j}
|
|_| dkrø|j} | |_| dkr|j} | |_| dkr6|dk    r0|j} ndg} | |_|dkrV|dk    rV|j}||_|    |_|dkr¦|dk    r®|jdk    r®|jdk    r®|j›d|j ¡›}n| ¡}|dk    rÄ| dd¡}||_|dkrä|dk    rä|j}||_|dkr|dk    r|j}||_g|_d|_i|_tƒ|_dS)NÚmetaz--helpÚ_ú-r) rpr4rqÚparamsÚargsÚprotected_argsÚsetÚ _opt_prefixesrrÚgetattrÚ_metartÚgetÚinvoked_subcommandrurvrxryrzr{r|rwrsÚupperÚreplacer}r~Z_close_callbacksÚ_depthÚ_parameter_sourcerÚ _exit_stack)Úselfr4rprqrrrsrtrurvrwrxryrzr{r|r}r~r:r:r;Ú__init__sŒÿþýü  
 
 
 
þ
ÿþýÿ
 zContext.__init__©r0cCs$|j |¡|j|j|j|j|jdœS)a*Gather information that could be useful for a tool generating
        user-facing documentation. This traverses the entire CLI
        structure.
 
        .. code-block:: python
 
            with Context(cli) as ctx:
                info = ctx.to_info_dict()
 
        .. versionadded:: 8.0
        )r4rqrxryrzrs)r4Ú to_info_dictrqrxryrzrs©rr:r:r;r“°s
úzContext.to_info_dictcCs|jd7_t|ƒ|S©Nr
)rrr”r:r:r;Ú    __enter__ÅszContext.__enter__)Úexc_typeÚ    exc_valueÚtbr0cCs*|jd8_|jdkr | ¡tƒdS©Nr
r)rÚcloser)rr—r˜r™r:r:r;Ú__exit__Ês
zContext.__exit__T)Úcleanupr0c    csF|s|jd7_z| }|VW5QRXW5|s@|jd8_XdS)aIThis helper method can be used with the context object to promote
        it to the current thread local (see :func:`get_current_context`).
        The default behavior of this is to invoke the cleanup functions which
        can be disabled by setting `cleanup` to `False`.  The cleanup
        functions are typically used for things such as closing file handles.
 
        If the cleanup is intended the context object can also be directly
        used as a context manager.
 
        Example usage::
 
            with ctx.scope():
                assert get_current_context() is ctx
 
        This is equivalent::
 
            with ctx:
                assert get_current_context() is ctx
 
        .. versionadded:: 5.0
 
        :param cleanup: controls if the cleanup functions should be run or
                        not.  The default is to run these functions.  In
                        some situations the context only wants to be
                        temporarily pushed in which case this can be disabled.
                        Nested pushes automatically defer the cleanup.
        r
N)r)rrÚrvr:r:r;ÚscopeÕsz Context.scopecCs|jS)a•This is a dictionary which is shared with all the contexts
        that are nested.  It exists so that click utilities can store some
        state here if they need to.  It is however the responsibility of
        that code to manage this dictionary well.
 
        The keys are supposed to be unique dotted strings.  For instance
        module paths are a good choice for it.  What is stored in there is
        irrelevant for the operation of click.  However what is important is
        that code that places data here adheres to the general semantics of
        the system.
 
        Example usage::
 
            LANG_KEY = f'{__name__}.lang'
 
            def set_language(value):
                ctx = get_current_context()
                ctx.meta[LANG_KEY] = value
 
            def get_language():
                return get_current_context().meta.get(LANG_KEY, 'en_US')
 
        .. versionadded:: 5.0
        )rˆr”r:r:r;rûsz Context.metacCs|j|j|jdS)a=Creates the :class:`~click.HelpFormatter` for the help and
        usage output.
 
        To quickly customize the formatter class used without overriding
        this method, set the :attr:`formatter_class` attribute.
 
        .. versionchanged:: 8.0
            Added the :attr:`formatter_class` attribute.
        )ÚwidthÚ    max_width)rorurvr”r:r:r;Úmake_formatters
ÿzContext.make_formatter)Úcontext_managerr0cCs |j |¡S)aÙRegister a resource as if it were used in a ``with``
        statement. The resource will be cleaned up when the context is
        popped.
 
        Uses :meth:`contextlib.ExitStack.enter_context`. It calls the
        resource's ``__enter__()`` method and returns the result. When
        the context is popped, it closes the stack, which calls the
        resource's ``__exit__()`` method.
 
        To register a cleanup function for something that isn't a
        context manager, use :meth:`call_on_close`. Or use something
        from :mod:`contextlib` to turn it into a context manager first.
 
        .. code-block:: python
 
            @click.group()
            @click.option("--name")
            @click.pass_context
            def cli(ctx):
                ctx.obj = ctx.with_resource(connect_db(name))
 
        :param context_manager: The context manager to enter.
        :return: Whatever ``context_manager.__enter__()`` returns.
 
        .. versionadded:: 8.0
        )rÚ enter_context)rr£r:r:r;Ú with_resource%szContext.with_resource.©Úfr0cCs |j |¡S)a…Register a function to be called when the context tears down.
 
        This can be used to close resources opened during the script
        execution. Resources that support Python's context manager
        protocol which would be used in a ``with`` statement should be
        registered with :meth:`with_resource` instead.
 
        :param f: The function to execute on teardown.
        )rÚcallback)rr§r:r:r;Ú call_on_closeBs
zContext.call_on_closecCs|j ¡tƒ|_dS)zœInvoke all close callbacks registered with
        :meth:`call_on_close`, and exit all context managers entered
        with :meth:`with_resource`.
        N)rr›rr”r:r:r;r›Ns
z Context.closecCsvd}|jdk    r|j}|jdk    rn|jjg}t|jjtƒrZ|jj |¡D]}| | |¡¡qDd     |¡›d|›}| 
¡S)zÏThe computed command path.  This is used for the ``usage``
        information on the help page.  It's automatically created by
        combining the info names of the chain of contexts to the root.
        ÚNú ) rqrpÚ command_pathrBr4r,Ú
get_paramsÚextendÚget_usage_piecesÚjoinÚlstrip)rržZparent_command_pathrPr:r:r;r¬Ws
 
 
zContext.command_pathcCs|}|jdk    r|j}q|S)zFinds the outermost context.N©rp)rÚnoder:r:r;Ú    find_rootjs
zContext.find_root)Ú object_typer0cCs*|}|dk    r&t|j|ƒr|jS|j}qdS)z)Finds the closest object of a given type.N)rBrrrp)rrµr³r:r:r;Ú find_objectqs  zContext.find_objectcCs"| |¡}|dkr|ƒ|_}|S)z€Like :meth:`find_object` but sets the innermost object to a
        new instance of `object_type` if it does not exist.
        N)r¶rr)rrµržr:r:r;Ú ensure_object}s
 zContext.ensure_objectúte.Literal[True])r9Úcallr0cCsdSrJr:©rr9r¹r:r:r;Úlookup_default†szContext.lookup_defaultzte.Literal[False]cCsdSrJr:rºr:r:r;r»ŒscCs0|jdk    r,|j |¡}|r(t|ƒr(|ƒS|SdS)a*Get the default for a parameter from :attr:`default_map`.
 
        :param name: Name of the parameter.
        :param call: If the default is a callable, call it. Disable to
            return the callable instead.
 
        .. versionchanged:: 8.0
            Added the ``call`` parameter.
        N)rtr‰Úcallable)rr9r¹Úvaluer:r:r;r»’s
 
  ú te.NoReturn)Úmessager0cCst||ƒ‚dS)zŒAborts the execution of the program with a specific error
        message.
 
        :param message: the error message to fail with.
        Nr)rr¿r:r:r;Úfail¦sz Context.failcCs
tƒ‚dS)zAborts the script.Nr r”r:r:r;Úabort®sz Context.abortr)Úcoder0cCs t|ƒ‚dS)z-Exits the application with a given exit code.Nr)rrÂr:r:r;Úexit²sz Context.exitcCs |j |¡S)zaHelper method to get formatted usage string for the current
        context and command.
        )r4Ú    get_usager”r:r:r;rĶszContext.get_usagecCs |j |¡S)z^Helper method to get formatted help page for the current
        context and command.
        )r4Úget_helpr”r:r:r;rższContext.get_help)r4r0cCst|ƒ||j|dS)zvCreate a new context of the same type as this context, but
        for a new command.
 
        :meta private:
        ©rqrp)rDr9)rr4r:r:r;Ú_make_sub_contextÂszContext._make_sub_contextút.Callable[..., V])Ú_Context__callbackrƒÚkwargsr0cOsdSrJr:©Ú_Context__selfrÉrƒrÊr:r:r;ÚinvokeÊszContext.invokecOsdSrJr:rËr:r:r;rÍÓs)r,rÈc OsÆt|tƒr||}|jdkr"tdƒ‚nt d|j¡}| |¡}|jD],}|j|kr@|j    r@| 
||  |¡¡||j<q@|j  |¡n|}t |ƒ4|$|||ŽW5QR£W5QR£SQRXW5QRXdS)aÐInvokes a command callback in exactly the way it expects.  There
        are two ways to invoke this method:
 
        1.  the first argument can be a callback and all other arguments and
            keyword arguments are forwarded directly to the function.
        2.  the first argument is a click command object.  In that case all
            arguments are forwarded as well but proper click parameters
            (options and click arguments) must be keyword arguments and Click
            will fill in defaults.
 
        Note that before Click 3.2 keyword arguments were not properly filled
        in against the intention of this code and no context was created.  For
        more information about this change and why it was done in a bugfix
        release see :ref:`upgrade-to-3.2`.
 
        .. versionchanged:: 8.0
            All ``kwargs`` are tracked in :attr:`params` so they will be
            passed if :meth:`forward` is called at multiple levels.
        Nz?The given command does not have a callback that can be invoked.rÈ)rBr,r¨Ú    TypeErrorr1r2rÇr‚r9Ú expose_valueÚtype_cast_valueÚ get_defaultÚupdaterR)rÌrÉrƒrÊZ    other_cmdr.rPr:r:r;rÍÜs&
 
ÿ
 
ÿ 
)Ú _Context__cmdrƒrÊr0cOsFt|tƒstdƒ‚|jD]}||kr|j|||<q|j|f|ž|ŽS)azSimilar to :meth:`invoke` but fills in default keyword
        arguments from the current context if the other command expects
        it.  This cannot invoke callbacks directly, only other commands.
 
        .. versionchanged:: 8.0
            All ``kwargs`` are tracked in :attr:`params` so they will be
            passed if ``forward`` is called at multiple levels.
        zCallback is not a command.)rBr,rÎr‚rÍ)rÌrÓrƒrÊrPr:r:r;Úforwards
 
zContext.forward)r9Úsourcer0cCs||j|<dS)zùSet the source of a parameter. This indicates the location
        from which the value of the parameter was obtained.
 
        :param name: The name of the parameter.
        :param source: A member of :class:`~click.core.ParameterSource`.
        N)rŽ)rr9rÕr:r:r;Úset_parameter_source&szContext.set_parameter_source)r9r0cCs |j |¡S)aXGet the source of a parameter. This indicates the location
        from which the value of the parameter was obtained.
 
        This can be useful for determining when a user specified a value
        on the command line that is the same as the default value. It
        will be :attr:`~click.core.ParameterSource.DEFAULT` only if the
        value was actually taken from the default.
 
        :param name: The name of the parameter.
        :rtype: ParameterSource
 
        .. versionchanged:: 8.0
            Returns ``None`` if the parameter was not provided from any
            source.
        )rŽr‰)rr9r:r:r;Úget_parameter_source/szContext.get_parameter_source)NNNNNNNFNNNNNNN)T)T).)T)r)5rErerfrgrror1ÚTypeÚ__annotations__ÚOptionalÚstrÚAnyÚMutableMappingÚintraÚListÚCallabler‘ÚDictr“r–Ú BaseExceptionr    rœrÚIteratorrŸÚpropertyrr¢ÚContextManagerr*r¥r©r›r¬r´r¶r·Úoverloadr»ÚUnionrÀrÁrÃrÄrÅrÇrÍrÔrdrÖr×r:r:r:r;r+ sÌ
aï
î -û %(          ÿ
þÿ þûû
û 6þ     c    @seZdZUdZeZejeed<dZ    dZ
dZ d.ej e ej eje ejfddœdd„Zeeje ejfd    œd
d „Ze d œd d„Zee d    œdd„Zee d    œdd„Zd/ej e eje ej eejedœdd„Zeeje eje dœdd„Zeejd    œdd„Zee ejddœdd„Zejd0ej eje ej e ej e dejd d!œd"d#„ƒZejd1ej eje ej e ej e eejejd!œd%d#„ƒZd2ej eje ej e ej e eeejejd&œd'd#„Zd3eje ejfe ej e dd(œd)d*„Zejejejd+œd,d-„Z dS)4Ú BaseCommanda¡The base command implements the minimal API contract of commands.
    Most code will never use this as it does not implement a lot of useful
    functionality but it can act as the direct subclass of alternative
    parsing methods that do not depend on the Click parser.
 
    For instance, this can be used to bridge Click and other systems like
    argparse or docopt.
 
    Because base commands do not implement a lot of the API that other
    parts of Click take for granted, they are not supported for all
    operations.  For instance, they cannot be used with the decorators
    usually and they have no built-in callback system.
 
    .. versionchanged:: 2.0
       Added the `context_settings` parameter.
 
    :param name: the name of the command to use unless a group overrides it.
    :param context_settings: an optional dictionary with defaults that are
                             passed to the context object.
    Ú context_classFTN)r9Úcontext_settingsr0cCs||_|dkri}||_dSrJ)r9rê)rr9rêr:r:r;r‘cs    zBaseCommand.__init__©r.r0cCs
d|jiS)aiGather information that could be useful for a tool generating
        user-facing documentation. This traverses the entire structure
        below this command.
 
        Use :meth:`click.Context.to_info_dict` to traverse the entire
        CLI structure.
 
        :param ctx: A :class:`Context` representing this command.
 
        .. versionadded:: 8.0
        r9©r9©rr.r:r:r;r“ts zBaseCommand.to_info_dictr’cCsd|jj›d|j›dS©Nú<r«ú>©Ú    __class__rEr9r”r:r:r;Ú__repr__‚szBaseCommand.__repr__cCs tdƒ‚dS)NzBase commands cannot get usage©ÚNotImplementedErrorrír:r:r;rąszBaseCommand.get_usagecCs tdƒ‚dS)NzBase commands cannot get helprôrír:r:r;rňszBaseCommand.get_help)rqrƒrpÚextrar0c    Ksd|j ¡D]\}}||kr
|||<q
|j|f||dœ|—Ž}|jdd| ||¡W5QRX|S)aÞThis function when given an info name and arguments will kick
        off the parsing and create a new :class:`Context`.  It does not
        invoke the actual command callback though.
 
        To quickly customize the context class used without overriding
        this method, set the :attr:`context_class` attribute.
 
        :param info_name: the info name for this invocation.  Generally this
                          is the most descriptive name for the script or
                          command.  For the toplevel script it's usually
                          the name of the script, for commands below it's
                          the name of the command.
        :param args: the arguments to parse as list of strings.
        :param parent: the parent context if available.
        :param extra: extra keyword arguments forwarded to the context
                      constructor.
 
        .. versionchanged:: 8.0
            Added the :attr:`context_class` attribute.
        rÆF©r)rêÚitemsrérŸÚ
parse_args)rrqrƒrprör_r½r.r:r:r;Ú make_context‹s
ÿÿÿzBaseCommand.make_context©r.rƒr0cCs tdƒ‚dS)zÑGiven a context and a list of arguments this creates the parser
        and parses the arguments, then modifies the context as necessary.
        This is automatically invoked by :meth:`make_context`.
        z1Base commands do not know how to parse arguments.Nrô)rr.rƒr:r:r;rù²szBaseCommand.parse_argscCs tdƒ‚dS)z{Given a context, this invokes the command.  The default
        implementation is raising a not implemented error.
        z*Base commands are not invocable by defaultNrôrír:r:r;r͹szBaseCommand.invoker'r-csZddlm‰g}ˆjdk    rVˆj‰tˆjtƒrˆjjr| ‡‡fdd„tˆ|ƒDƒ¡q|S)a×Return a list of completions for the incomplete value. Looks
        at the names of chained multi-commands.
 
        Any command could be part of a chained multi-command, so sibling
        commands are valid at any point during command completion. Other
        command classes will return more completions.
 
        :param ctx: Invocation context for this command.
        :param incomplete: Value being completed. May be empty.
 
        .. versionadded:: 8.0
        rr&Nc3s,|]$\}}|ˆjkrˆ|| ¡dVqdS©©ÚhelpN)r„Úget_short_help_str©Ú.0r9r4©r'r.r:r;Ú    <genexpr>Ôs
þz-BaseCommand.shell_complete.<locals>.<genexpr>)    Úclick.shell_completionr'rprBr4r3rAr®r<©rr.r/Úresultsr:rr;Úshell_complete¿s 
þ
zBaseCommand.shell_completer¸r¾)rƒÚ    prog_nameÚ complete_varÚstandalone_moderör0cKsdSrJr:©rrƒrr    r
rör:r:r;ÚmainÜs    zBaseCommand.main.cKsdSrJr:r r:r:r;r çs    )rƒrr    r
Úwindows_expand_argsrör0c
 
Ks|dkr.tjdd…}tjdkr6|r6t|ƒ}nt|ƒ}|dkrDtƒ}| |||¡z0zJ|j||f|Ž0}|     |¡}|sŒ|W5QR£WWS| 
¡W5QRXWnàt t fk
rÚ}    zt tjdtƒ|    ‚W5d}    ~    XYn¨tk
r}    z|sò‚|     ¡t 
|    j¡W5d}    ~    XYnltk
r€}    zL|    jtjkrnt tjttjƒ¡t_t tjttjƒ¡t_t 
d¡n‚W5d}    ~    XYnXWn~tk
rÊ}    z&|r¬t 
|    j¡n|    jWY¢SW5d}    ~    XYn:tk
r|sâ‚t tdƒtjdt 
d¡YnXdS)aÛThis is the way to invoke a script with all the bells and
        whistles as a command line application.  This will always terminate
        the application after a call.  If this is not wanted, ``SystemExit``
        needs to be caught.
 
        This method is also available by directly calling the instance of
        a :class:`Command`.
 
        :param args: the arguments that should be used for parsing.  If not
                     provided, ``sys.argv[1:]`` is used.
        :param prog_name: the program name that should be used.  By default
                          the program name is constructed by taking the file
                          name from ``sys.argv[0]``.
        :param complete_var: the environment variable that controls the
                             bash completion support.  The default is
                             ``"_<prog_name>_COMPLETE"`` with prog_name in
                             uppercase.
        :param standalone_mode: the default behavior is to invoke the script
                                in standalone mode.  Click will then
                                handle exceptions and convert them into
                                error messages and the function will never
                                return but shut down the interpreter.  If
                                this is set to `False` they will be
                                propagated to the caller and the return
                                value of this function is the return value
                                of :meth:`invoke`.
        :param windows_expand_args: Expand glob patterns, user dir, and
            env vars in command line args on Windows.
        :param extra: extra keyword arguments are forwarded to the context
                      constructor.  See :class:`Context` for more information.
 
        .. versionchanged:: 8.0.1
            Added the ``windows_expand_args`` parameter to allow
            disabling command line arg expansion on Windows.
 
        .. versionchanged:: 8.0
            When taking arguments from ``sys.argv`` on Windows, glob
            patterns, user dir, and env vars are expanded.
 
        .. versionchanged:: 3.0
           Added the ``standalone_mode`` parameter.
        Nr
Únt)ÚfilezAborted!)ÚsysÚargvÚosr9r!rKr Ú_main_shell_completionrúrÍrÃÚEOFErrorÚKeyboardInterruptr"Ústderrr rÚshowZ    exit_codeÚOSErrorÚerrnoÚEPIPEr1r2ÚTextIOr%Ústdoutrr€)
rrƒrr    r
r rör.ržrQr:r:r;r òsL3
 
 
)Úctx_argsrr    r0cCsj|dkr,| dd¡ dd¡}d|›d ¡}tj |¡}|s@dSddlm}||||||ƒ}t |¡dS)aøCheck if the shell is asking for tab completion, process
        that, then exit early. Called from :meth:`main` before the
        program is invoked.
 
        :param prog_name: Name of the executable in the shell.
        :param complete_var: Name of the environment variable that holds
            the completion instruction. Defaults to
            ``_{PROG_NAME}_COMPLETE``.
 
        .. versionchanged:: 8.2.0
            Dots (``.``) in ``prog_name`` are replaced with underscores (``_``).
        Nrr€Ú.Z    _COMPLETEr
)r)    rŒr‹rÚenvironr‰Úshell_completionrrrÃ)rrrr    Z complete_nameZ instructionrržr:r:r;rcs  z"BaseCommand._main_shell_completion©rƒrÊr0cOs |j||ŽS)zAlias for :meth:`main`.)r ©rrƒrÊr:r:r;Ú__call__ƒszBaseCommand.__call__)N)N)NNNT)NNN.)NNNTT)N)!rErerfrgr+rér1rØrÙrxryrzrÚrÛrÝrÜr‘rár“rórÄrÅrßrúrùrÍrræÚSequencer rarr#r:r:r:r;rèBs”
ýü üú 'ûù
ûù úø uüû  rècsîeZdZdZd5ejeejejeejfejej    dejfejej
dejeejeejeejee e e e ddœ ‡fd    d
„ Z e ejeejfd œ‡fd d „ Ze ed œdd„Ze ej
dd œdd„Ze eddœdd„Ze ej
ed œdd„Ze ej
ed œdd„Ze ejdd œdd„Ze ed œdd„Ze ed œdd„Zd6eed!œd"d#„Ze eddœd$d%„Ze eddœd&d'„Ze eddœd(d)„Ze eddœd*d+„Ze ej
eej
ed,œd-d.„Z e ejd œd/d0„Z!e eej
d1d2œ‡fd3d4„ Z"‡Z#S)7r,aîCommands are the basic building block of command line interfaces in
    Click.  A basic command handles command line parsing and might dispatch
    more parsing to commands nested below it.
 
    :param name: the name of the command to use unless a group overrides it.
    :param context_settings: an optional dictionary with defaults that are
                             passed to the context object.
    :param callback: the callback to invoke.  This is optional.
    :param params: the parameters to register with this command.  This can
                   be either :class:`Option` or :class:`Argument` objects.
    :param help: the help string to use for this command.
    :param epilog: like the help string but it's printed at the end of the
                   help page after everything else.
    :param short_help: the short help to use for this command.  This is
                       shown on the command listing of the parent command.
    :param add_help_option: by default each command registers a ``--help``
                            option.  This can be disabled by this parameter.
    :param no_args_is_help: this controls what happens if no arguments are
                            provided.  This option is disabled by default.
                            If enabled this will add ``--help`` as argument
                            if no arguments are passed
    :param hidden: hide this command from help outputs.
 
    :param deprecated: issues a message indicating that
                             the command is deprecated.
 
    .. versionchanged:: 8.1
        ``help``, ``epilog``, and ``short_help`` are stored unprocessed,
        all formatting is done when outputting help text, not at init,
        and is done even if not using the ``@command`` decorator.
 
    .. versionchanged:: 8.0
        Added a ``repr`` showing the command name.
 
    .. versionchanged:: 7.1
        Added the ``no_args_is_help`` parameter.
 
    .. versionchanged:: 2.0
        Added the ``context_settings`` parameter.
    Nú    [OPTIONS]TF.rO) r9rêr¨r‚rþÚepilogÚ
short_helpÚoptions_metavarÚadd_help_optionÚno_args_is_helpr8Ú
deprecatedr0c sRtƒ ||¡||_|pg|_||_||_||_||_|    |_|
|_    | |_
| |_ dSrJ) Úsuperr‘r¨r‚rþr&r(r'r)r*r8r+) rr9rêr¨r‚rþr&r'r(r)r*r8r+©ròr:r;r‘²s
zCommand.__init__rëcs@tƒ |¡}|jdd„| |¡Dƒ|j|j|j|j|jd|S)NcSsg|] }| ¡‘qSr:)r“)rrPr:r:r;Ú
<listcomp>Õsz(Command.to_info_dict.<locals>.<listcomp>)r‚rþr&r'r8r+)    r,r“rÒr­rþr&r'r8r+)rr.Ú    info_dictr-r:r;r“Òs úzCommand.to_info_dictcCs"| ¡}| ||¡| ¡ d¡S)zmFormats the usage line into a string and returns it.
 
        Calls :meth:`format_usage` internally.
        Ú
)r¢Ú format_usageÚgetvalueÚrstrip©rr.Ú    formatterr:r:r;rÄÞs zCommand.get_usagecCs&|j}| |¡}|dk    r"||f•}|SrJ)r‚Úget_help_option)rr.ržÚ help_optionr:r:r;r­çs
 
 
zCommand.get_params©r.r5r0cCs"| |¡}| |jd |¡¡dS)zsWrites the usage line into the formatter.
 
        This is a low-level method called by :meth:`get_usage`.
        r«N)Úcollect_usage_piecesZ write_usager¬r°)rr.r5Úpiecesr:r:r;r1ðs
zCommand.format_usagecCs6|jr|jgng}| |¡D]}| | |¡¡q|S)zhReturns all the pieces that go into the usage line and returns
        it as a list of strings.
        )r(r­r®r¯)rr.ržrPr:r:r;r9øszCommand.collect_usage_piecescCs6t|jƒ}|jD]}| |j¡| |j¡qt|ƒS)z&Returns the names for the help option.)r…r{r‚Údifference_updateÚoptsÚsecondary_optsrK)rr.Z    all_namesrPr:r:r;Úget_help_option_namess
 
 
 zCommand.get_help_option_namesÚOptioncCsD| |¡}|r|jsdStdtddœdd„}t|ddd|tdƒd    S)
zReturns the help option object.NrO)r.rPr½r0cSs(|r$|js$t| ¡|jd| ¡dS)N©r})rwr"rÅr}rÃ)r.rPr½r:r:r;Ú    show_helps
z*Command.get_help_option.<locals>.show_helpTFzShow this message and exit.)Úis_flagrZrÏr¨rþ)r>r)r+rÛr?r€)rr.Ú help_optionsrAr:r:r;r6 s
 
úzCommand.get_help_optioncCs(t|ƒ}| |¡D]}| ||¡q|S)z6Creates the underlying option parser for this command.)rr­Ú add_to_parser)rr.ÚparserrPr:r:r;Ú make_parser szCommand.make_parsercCs"| ¡}| ||¡| ¡ d¡S)zfFormats the help into a string and returns it.
 
        Calls :meth:`format_help` internally.
        r0)r¢Ú format_helpr2r3r4r:r:r;rÅ's zCommand.get_helpé-)Úlimitr0cCsJ|jrt |j¡}n|jr(t|j|ƒ}nd}|jrBtdƒj|d}| ¡S)z`Gets short help for the command or makes it by shortening the
        long help string.
        rªú(Deprecated) {text}©Útext)    r'ÚinspectÚcleandocrþr#r+r€ÚformatÚstrip)rrIrLr:r:r;rÿ0szCommand.get_short_help_strcCs4| ||¡| ||¡| ||¡| ||¡dS)a0Writes the help into the formatter if it exists.
 
        This is a low-level method called by :meth:`get_help`.
 
        This calls the following methods:
 
        -   :meth:`format_usage`
        -   :meth:`format_help_text`
        -   :meth:`format_options`
        -   :meth:`format_epilog`
        N)r1Úformat_help_textÚformat_optionsÚ format_epilogr4r:r:r;rG@s   zCommand.format_helpc    Csj|jdk    r"t |j¡ d¡d}nd}|jr<tdƒj|d}|rf| ¡| ¡|     |¡W5QRXdS)z3Writes the help text to the formatter if it exists.Nú rrªrJrK)
rþrMrNÚ    partitionr+r€rOÚwrite_paragraphÚ indentationÚ
write_text)rr.r5rLr:r:r;rQQs
 
zCommand.format_help_textc    Cs\g}| |¡D] }| |¡}|dk    r| |¡q|rX| tdƒ¡| |¡W5QRXdS)z8Writes all the options into the formatter if they exist.NÚOptions)r­Úget_help_recordÚappendÚsectionr€Úwrite_dl)rr.r5r<rPržr:r:r;rRbs
 zCommand.format_optionsc    Cs<|jr8t |j¡}| ¡| ¡| |¡W5QRXdS)z2Writes the epilog into the formatter if it exists.N)r&rMrNrVrWrX)rr.r5r&r:r:r;rSns
 
zCommand.format_epilogrûcCsÀ|s*|jr*|js*t| ¡|jd| ¡| |¡}|j|d\}}}t||     |¡ƒD]}| 
|||¡\}}qV|r¨|j s¨|js¨|  t ddt|ƒƒjd tt|ƒ¡d¡||_|j |j¡|S)Nr@)rƒz&Got unexpected extra argument ({args})z'Got unexpected extra arguments ({args})r«)r*rwr"rÅr}rÃrFrùrcr­Úhandle_parse_resultrxrÀrÚlenrOr°ÚmaprÛrƒr†rÒ)rr.rƒrEr<Z param_orderrPr½r:r:r;rùws(
ýüÿzCommand.parse_argscCsL|jr,tdƒj|jd}tt|dddd|jdk    rH|j|jf|jŽSdS)zeGiven a context, this invokes the attached callback (if it exists)
        in the right way.
        z7DeprecationWarning: The command {name!r} is deprecated.rìÚred)ZfgT)ÚerrN)    r+r€rOr9r"rr¨rÍr‚)rr.r¿r:r:r;r͏sÿþ
zCommand.invoker'r-cs–ddlm‰g}ˆr~ˆd ¡s~| |¡D]R‰tˆtƒr*ˆjs*ˆjsX| ˆj    ¡t
j krXq*|  ‡‡‡fdd„ˆj ˆj•Dƒ¡q*|  tƒ |ˆ¡¡|S)aReturn a list of completions for the incomplete value. Looks
        at the names of options and chained multi-commands.
 
        :param ctx: Invocation context for this command.
        :param incomplete: Value being completed. May be empty.
 
        .. versionadded:: 8.0
        rr&c3s&|]}| ˆ¡rˆ|ˆjdVqdSrü)r6rþ)rr9©r'r/rPr:r;r¶s
þz)Command.shell_complete.<locals>.<genexpr>)rr'Úisalnumr­rBr?r8Úmultipler×r9rdrjr®r<r=r,rrr-rcr;rœs(     ÿþü
ÿû    
þ
zCommand.shell_complete) NNNNNNr%TFFF)rH)$rErerfrgr1rÚrÛrÝrÜràrßrar‘r+rár“rÄr­rr1r9r>r6rrFrÅrÞrÿrGrQrRrSrùrÍrÚ __classcell__r:r:r-r;r,ˆsX,óò                      c
sœeZdZdZdZdZd&ejee    eje    ejee    ejej
dej fej ddœ‡fdd„ Z e ejeej fd    œ‡fd
d „ Ze ejed    œ‡fd d „ Ze eddœ‡fdd„ Zd'e    ej
egefdœdd„Ze eddœdd„Ze ejeejedœ‡fdd„ Ze ej d    œ‡fdd„ Ze ejeejejeejeejefdœdd„Ze eejedœdd„Ze ejed    œd d!„Ze eejd"d#œ‡fd$d%„ Z‡ZS)(r3a¢A multi command is the basic implementation of a command that
    dispatches to subcommands.  The most common version is the
    :class:`Group`.
 
    :param invoke_without_command: this controls how the multi command itself
                                   is invoked.  By default it's only invoked
                                   if a subcommand is provided.
    :param no_args_is_help: this controls what happens if no arguments are
                            provided.  This option is enabled by default if
                            `invoke_without_command` is disabled or disabled
                            if it's enabled.  If enabled this will add
                            ``--help`` as argument if no arguments are
                            passed.
    :param subcommand_metavar: the string that is used in the documentation
                               to indicate the subcommand place.
    :param chain: if this is set to `True` chaining of multiple subcommands
                  is enabled.  This restricts the form of commands in that
                  they cannot have optional arguments but it allows
                  multiple commands to be chained together.
    :param result_callback: The result callback to attach to this multi
        command. This can be set or changed later with the
        :meth:`result_callback` decorator.
    :param attrs: Other command arguments described in :class:`Command`.
    TFN.)r9Úinvoke_without_commandr*Úsubcommand_metavarrAÚresult_callbackÚattrsr0c     s€tƒj|f|Ž|dkr| }||_||_|dkr@|r<d}nd}||_||_||_|jr||jD]}t|t    ƒr^|j
s^t dƒ‚q^dS)Nz*COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...zCOMMAND [ARGS]...z<Multi commands in chain mode cannot have optional arguments.) r,r‘r*rgrhrAÚ_result_callbackr‚rBÚArgumentÚrequiredrC)    rr9rgr*rhrArirjrPr-r:r;r‘Ýs$
 
ÿzMultiCommand.__init__rëc
sztƒ |¡}i}| |¡D]J}| ||¡}|dkr4q| |¡}|jdd| |¡||<W5QRXq|j||jd|S)NFr÷)ÚcommandsrA)r,r“r5r7rÇrŸrÒrA)rr.r/rnr9r4Úsub_ctxr-r:r;r“s  
zMultiCommand.to_info_dictcstƒ |¡}| |j¡|SrJ)r,r9r[rh©rr.ržr-r:r;r9s  z!MultiCommand.collect_usage_piecesr8cstƒ ||¡| ||¡dSrJ)r,rRÚformat_commandsr4r-r:r;rRszMultiCommand.format_options)rŒr0csttdœ‡‡fdd„ }|S)a¶Adds a result callback to the command.  By default if a
        result callback is already registered this will chain them but
        this can be disabled with the `replace` parameter.  The result
        callback is invoked with the return value of the subcommand
        (or the list of return values from all subcommands if chaining
        is enabled) as well as the parameters as they would be passed
        to the main callback.
 
        Example::
 
            @click.group()
            @click.option('-i', '--input', default=23)
            def cli(input):
                return 42
 
            @cli.result_callback()
            def process_result(result, input):
                return result + input
 
        :param replace: if set to `True` an already existing result
                        callback will be removed.
 
        .. versionchanged:: 8.0
            Renamed from ``resultcallback``.
 
        .. versionadded:: 3.0
        r¦csFˆj‰ˆdksˆrˆˆ_ˆS‡‡fdd„}tt t|¡ˆƒˆ_}|S)Ncs ˆ|f|ž|Ž}ˆ|f|ž|ŽSrJr:)Z_MultiCommand__valuerƒrÊÚinner©r§Z old_callbackr:r;ÚfunctionBszAMultiCommand.result_callback.<locals>.decorator.<locals>.function)rkrr1r2r()r§rtrž©rŒrrsr;Ú    decorator;s z/MultiCommand.result_callback.<locals>.decorator)r()rrŒrvr:rur;riszMultiCommand.result_callbackc        Csºg}| |¡D]0}| ||¡}|dkr(q|jr0q| ||f¡qt|ƒr¶|jdtdd„|Dƒƒ}g}|D] \}}| |¡}| ||f¡ql|r¶| t    dƒ¡| 
|¡W5QRXdS)zeExtra format methods for multi methods that adds all the commands
        after the options.
        Nécss|]}t|dƒVqdS)rN©r_)rr?r:r:r;r\sz/MultiCommand.format_commands.<locals>.<genexpr>ÚCommands) r5r7r8r[r_r Úmaxrÿr\r€r])    rr.r5rnÚ
subcommandr?rIÚrowsrþr:r:r;rqKs"  
zMultiCommand.format_commandsrûcst|s*|jr*|js*t| ¡|jd| ¡tƒ ||¡}|jrL||_    g|_
n"|rn|dd…|dd…|_    |_
|j
S)Nr@r
) r*rwr"rÅr}rÃr,rùrAr„rƒ)rr.rƒÚrestr-r:r;rùgszMultiCommand.parse_argsc     sÚtjtjdœ‡‡fdd„ }ˆjsjˆjr\ˆ,tƒ ˆ¡}|ˆjrDgn|ƒW5QR£SQRXˆ tdƒ¡ˆjˆj    •}gˆ_    gˆ_ˆjsˆzˆ 
ˆ|¡\}}}|dk    s®t ‚|ˆ_ tƒ ˆ¡|j ||ˆd}|*||j |¡ƒW5QR£W5QR£SQRXW5QRXˆ¾|rdndˆ_ tƒ ˆ¡g}|rŠˆ 
ˆ|¡\}}}|dk    sZt ‚|j ||ˆddd    }| |¡|j    g}|_    q4g}|D](}|| |j |¡¡W5QRXq’||ƒW5QR£SQRXdS)
N©r½r0cs"ˆjdk    rˆjˆj|fˆjŽ}|SrJ)rkrÍr‚©r½©r.rr:r;Ú_process_resultws
z,MultiCommand.invoke.<locals>._process_resultzMissing command.r²Ú*TF)rprxry)r1rÜr„rgr,rÍrArÀr€rƒÚresolve_commandÚAssertionErrorrŠrúr4r[)    rr.rržrƒr>r?roZcontextsr-r€r;rÍvsP $   8 û
 zMultiCommand.invokecCsœt|dƒ}|}| ||¡}|dkrD|jdk    rD| |¡}| ||¡}|dkr‚|js‚t|ƒdrl| ||j¡| tdƒj    |d¡|rŠ|nd||dd…fS)NrzNo such command {name!r}.rìr
)
r$r7r|rwrrùrƒrÀr€rO)rr.rƒr>Zoriginal_cmd_namer?r:r:r;rƒºs  
  zMultiCommand.resolve_command©r.r>r0cCst‚dS)z{Given a context and a command name, this returns a
        :class:`Command` object if it exists or returns `None`.
        Nrô©rr.r>r:r:r;r7ÕszMultiCommand.get_commandcCsgS)zTReturns a list of subcommand names in the order they should
        appear.
        r:rír:r:r;r5ÛszMultiCommand.list_commandsr'r-cs<ddlm‰‡fdd„t||ƒDƒ}| tƒ ||¡¡|S)a0Return a list of completions for the incomplete value. Looks
        at the names of options, subcommands, and chained
        multi-commands.
 
        :param ctx: Invocation context for this command.
        :param incomplete: Value being completed. May be empty.
 
        .. versionadded:: 8.0
        rr&cs g|]\}}ˆ|| ¡d‘qS)rý)rÿrr&r:r;r.ísÿz/MultiCommand.shell_complete.<locals>.<listcomp>)rr'r<r®r,rrr-r&r;rás
 
þzMultiCommand.shell_complete)NFNNFN)F) rErerfrgrxryr1rÚrÛraràrÜr‘r+rár“rßr9rrRr(rirqrùrÍr`r,rƒr7r5rrfr:r:r-r;r3ÀsBù÷& -"E þ csüeZdZUdZdZejejee    d<dZ
ejej ejdeje fe    d<deje ejej eje efejefejddœ‡fdd„ Zdeeje ddœd    d
„Zejejd ejfed œd d„ƒZejejejejejd ejfgefdœdd„ƒZejejej ejejd ejfgefefdœdd„Zejejd ejfdd œdd„ƒZejejejejejd ejfgdfdœdd„ƒZejejej ejejd ejfgdfdfdœdd„Zee ejedœdd„Zeeje dœdd„Z‡ZS)ÚGroupaMA group allows a command to have subcommands attached. This is
    the most common way to implement nesting in Click.
 
    :param name: The name of the group command.
    :param commands: A dict mapping names to :class:`Command` objects.
        Can also be a list of :class:`Command`, which will use
        :attr:`Command.name` to create the dict.
    :param attrs: Other command arguments described in
        :class:`MultiCommand`, :class:`Command`, and
        :class:`BaseCommand`.
 
    .. versionchanged:: 8.0
        The ``commands`` argument can be a list of command objects.
    NÚ command_classÚ group_class)r9rnrjr0c sBtƒj|f|Ž|dkri}nt|tjƒr8dd„|Dƒ}||_dS)NcSsi|]}|jdk    r|j|“qSrJrì©rÚcr:r:r;Ú
<dictcomp>&s
z"Group.__init__.<locals>.<dictcomp>)r,r‘rBrr$rn)rr9rnrjr-r:r;r‘s  zGroup.__init__)r?r9r0cCs8|p|j}|dkrtdƒ‚t|||dd||j|<dS)zƒRegisters another :class:`Command` with this group.  If the name
        is not provided, the name of the command is used.
        NzCommand has no name.T)r@)r9rÎrGrn)rr?r9r:r:r;Ú add_command+s
 
zGroup.add_command.)Ú _Group__funcr0cCsdSrJr:©rrŽr:r:r;r45sz Group.commandr!cOsdSrJr:r"r:r:r;r49scsšddlm‰d}ˆrBtˆdƒrBtˆƒdkr0ˆr8tdƒ‚ˆ\}d‰ˆjr`ˆ d¡dkr`ˆjˆd<tjdtj    ft
d    œ‡‡‡‡fd
d „ }|dk    r–||ƒS|S) aA shortcut decorator for declaring and attaching a command to
        the group. This takes the same arguments as :func:`command` and
        immediately registers the created command with this group by
        calling :meth:`add_command`.
 
        To customize the command class used, set the
        :attr:`command_class` attribute.
 
        .. versionchanged:: 8.1
            This decorator can be applied without parentheses.
 
        .. versionchanged:: 8.0
            Added the :attr:`command_class` attribute.
        r
)r4Nrz7Use 'command(**kwargs)(callable)' to provide arguments.r:Úcls.r¦csˆˆˆŽ|ƒ}ˆ |¡|SrJ©r©r§r?©rƒr4rÊrr:r;rv^s
z Group.command.<locals>.decorator) Ú
decoratorsr4r¼r_r„rˆr‰r1ràrÜr,©rrƒrÊÚfuncrvr:r“r;r4?s" 
ÿÿþ
&cCsdSrJr:rr:r:r;Úgrouphsz Group.groupcOsdSrJr:r"r:r:r;r—lscs¶ddlm‰d}ˆrBtˆdƒrBtˆƒdkr0ˆr8tdƒ‚ˆ\}d‰ˆjdk    r|ˆ d¡dkr|ˆjtkrrtˆƒˆd<n
ˆjˆd<tj    dtj
fd    d
œ‡‡‡‡fd d „ }|dk    r²||ƒS|S) aA shortcut decorator for declaring and attaching a group to
        the group. This takes the same arguments as :func:`group` and
        immediately registers the created group with this group by
        calling :meth:`add_command`.
 
        To customize the group class used, set the :attr:`group_class`
        attribute.
 
        .. versionchanged:: 8.1
            This decorator can be applied without parentheses.
 
        .. versionchanged:: 8.0
            Added the :attr:`group_class` attribute.
        r
)r—Nrz5Use 'group(**kwargs)(callable)' to provide arguments.r:r.r‡r¦csˆˆˆŽ|ƒ}ˆ |¡|SrJr‘r’©rƒr—rÊrr:r;rv”s
zGroup.group.<locals>.decorator) r”r—r¼r_r„r‰r‰rDr1ràrÜr•r:r˜r;r—rs& 
ÿÿþ
 
&r…cCs |j |¡SrJ)rnr‰r†r:r:r;r7žszGroup.get_commandrëcCs
t|jƒSrJ)rbrnrír:r:r;r5¡szGroup.list_commands)NN)N)rErerfrgrˆr1rÚrØr,rÙr‰rçrDrÛrÝr$rÜr‘rræràr4r—r+r7rßr5rfr:r:r-r;r‡õsL
 (ûÿù
þ$þ )þ$þ ,r‡cs€eZdZdZdejeejejeej    ddœ‡fdd„ Z
eddœdd„Z e eeje d    œd
d „Ze ejed œd d„Z‡ZS)ÚCommandCollectionakA command collection is a multi command that merges multiple multi
    commands together into one.  This is a straightforward implementation
    that accepts a list of different multi commands as sources and
    provides all the commands for each of them.
 
    See :class:`MultiCommand` and :class:`Command` for the description of
    ``name`` and ``attrs``.
    N)r9Úsourcesrjr0c stƒj|f|Ž|pg|_dSrJ)r,r‘rš)rr9ršrjr-r:r;r‘¯szCommandCollection.__init__)Ú    multi_cmdr0cCs|j |¡dS)z1Adds a new multi command to the chain dispatcher.N)ršr[)rr›r:r:r;Ú
add_source¹szCommandCollection.add_sourcer…cCs>|jD]2}| ||¡}|dk    r|jr0t|||ƒ|SqdSrJ)ršr7rArG)rr.r>rÕržr:r:r;r7½s
 
zCommandCollection.get_commandrëcCs*tƒ}|jD]}| | |¡¡q t|ƒSrJ)r…ršrÒr5rb)rr.ržrÕr:r:r;r5És
zCommandCollection.list_commands)NN)rErerfrgr1rÚrÛrßr3rÜr‘rœr+r,r7r5rfr:r:r-r;r™¥s ýû
 r™r~cCst|tƒrt‚t|ƒS)ztCheck if the value is iterable but not a string. Raises a type
    error, or return an iterator over the value.
    )rBrÛrÎrMrr:r:r;Ú _check_iterÒs
rc@s*eZdZdZdZd<ejejeejej    e
j ej fe ejej    ej ejgej ffejejedej gej fejee ejee e ejej    eejefejejedegej    ejdejeffddœ dd    „Zejeej fd
œd d „Zed
œd d„Zejee ejejeejeejefdœdd„Zeed
œdd„ƒZed
œdd„Zejd=edejej dœdd„ƒZejd>ee ejej    ej ejgej ffdœdd„ƒZd?ee ejej    ej ejgej ffdœdd„Zeeddœdd„Zeejeej fejej e fd œd!d"„Z!eej ej d#œd$d%„Z"ej e d&œd'd(„Z#eej ej d#œd)d*„Z$eejed+œd,d-„Z%eejej d+œd.d/„Z&eejeej fejeejej ejefd0œd1d2„Z'eejejeefd+œd3d4„Z(eejed+œd5d6„Z)eed+œd7d8„Z*eeejdd9œd:d;„Z+dS)@rOa‚A parameter to a command comes in two versions: they are either
    :class:`Option`\s or :class:`Argument`\s.  Other subclasses are currently
    not supported by design as some of the internals for parsing are
    intentionally not finalized.
 
    Some settings are supported by both options and arguments.
 
    :param param_decls: the parameter declarations for this option or
                        argument.  This is a list of flags or argument
                        names.
    :param type: the type that should be used.  Either a :class:`ParamType`
                 or a Python type.  The latter is converted into the former
                 automatically if supported.
    :param required: controls if this is optional or not.
    :param default: the default value if omitted.  This can also be a callable,
                    in which case it's invoked when the default is needed
                    without any arguments.
    :param callback: A function to further process or validate the value
        after type conversion. It is called as ``f(ctx, param, value)``
        and must return the value. It is called for all sources,
        including prompts.
    :param nargs: the number of arguments to match.  If not ``1`` the return
                  value is a tuple instead of single value.  The default for
                  nargs is ``1`` (except if the type is a tuple, then it's
                  the arity of the tuple). If ``nargs=-1``, all remaining
                  parameters are collected.
    :param metavar: how the value is represented in the help page.
    :param expose_value: if this is `True` then the value is passed onwards
                         to the command callback and stored on the context,
                         otherwise it's skipped.
    :param is_eager: eager values are processed before non eager ones.  This
                     should not be set for arguments or it will inverse the
                     order of processing.
    :param envvar: a string or list of strings that are environment variables
                   that should be checked.
    :param shell_complete: A function that returns custom shell
        completions. Used instead of the param's type completion if
        given. Takes ``ctx, param, incomplete`` and must return a list
        of :class:`~click.shell_completion.CompletionItem` or a list of
        strings.
 
    .. versionchanged:: 8.0
        ``process_value`` validates required parameters and bounded
        ``nargs``, and invokes the parameter callback before returning
        the value. This allows the callback to validate prompts.
        ``full_process_value`` is removed.
 
    .. versionchanged:: 8.0
        ``autocompletion`` is renamed to ``shell_complete`` and has new
        semantics described above. The old name is deprecated and will
        be removed in 8.1, until then it will be wrapped to match the
        new requirements.
 
    .. versionchanged:: 8.0
        For ``multiple=True, nargs>1``, the default must be a list of
        tuples.
 
    .. versionchanged:: 8.0
        Setting a default is no longer required for ``nargs>1``, it will
        default to ``None``. ``multiple=True`` or ``nargs=-1`` will
        default to ``()``.
 
    .. versionchanged:: 7.1
        Empty environment variables are ignored rather than taking the
        empty string value. This makes it possible for scripts to clear
        variables if they can't unset them.
 
    .. versionchanged:: 2.0
        Changed signature for parameter callback to also be passed the
        parameter. The old callback format will still work, but it will
        raise a warning to give you a chance to migrate the code easier.
    Z    parameterNFTr') Ú param_declsrDrmÚdefaultr¨ÚnargsreÚmetavarrÏrZÚenvvarrr0c Cs¬|||| |pd|    ¡\|_|_|_t ||¡|_|dkrT|jjrP|jj}nd}||_    ||_
||_ ||_ |    |_ ||_|
|_||_| |_| |_|jjrÆ||jjkrÆtd|jj›d|j›d|›dƒ‚t|ƒsÒ|nd} | dk    r¨|rztt| ƒdƒ} Wn tk
rtdƒd‚YnX|dkr¨| dk    r¨z t| ƒWn0tk
rj|rXd}nd    }t|ƒd‚YnX|dkr¨t| ƒ|kr¨|rŽd
nd }td |›d |›dƒ‚dS)Nr:r
z'nargs' must be z (or None) for type z , but it was rz1'default' must be a list when 'multiple' is true.zK'default' must be a list of lists when 'multiple' is true and 'nargs' != 1.z+'default' must be a list when 'nargs' != 1.z item lengthÚlengthz
'default' z must match nargs=)Ú _parse_declsr9r<r=r Ú convert_typerDÚ is_compositeÚarityrmr¨r rerÏrŸrZr¡r¢Ú_custom_shell_completerXr¼ÚnextrrÎr_)rržrDrmrŸr¨r rer¡rÏrZr¢rÚ check_defaultr¿Úsubjectr:r:r;r‘(sfÿ
ÿ
ÿþ ÿÿzParameter.__init__r’c Cs2|j|j|j|j|j ¡|j|j|j|j    |j
dœ
S)zæGather information that could be useful for a tool generating
        user-facing documentation.
 
        Use :meth:`click.Context.to_info_dict` to traverse the entire
        CLI structure.
 
        .. versionadded:: 8.0
        )
r9Úparam_type_namer<r=rDrmr rerŸr¢) r9r¬r<r=rDr“rmr rerŸr¢r”r:r:r;r“€s
özParameter.to_info_dictcCsd|jj›d|j›dSrîrñr”r:r:r;ró–szParameter.__repr__©ÚdeclsrÏr0cCs
tƒ‚dSrJrô)rr®rÏr:r:r;r¤™szParameter._parse_declscCs|jS)zReturns the human readable name of this parameter.  This is the
        same as the name for options, but the metavar for arguments.
        rìr”r:r:r;Úhuman_readable_namežszParameter.human_readable_namecCsF|jdk    r|jS|j |¡}|dkr0|jj ¡}|jdkrB|d7}|S)Nr
ú...)r¡rDÚ get_metavarr9r‹r )rr¡r:r:r;Ú make_metavar¥s
 
zParameter.make_metavarr¸©r.r¹r0cCsdSrJr:©rr.r¹r:r:r;rѳszParameter.get_default.cCsdSrJr:r´r:r:r;rѹscCs4|j|jdd}|dkr|j}|r0t|ƒr0|ƒ}|S)aµGet the default for the parameter. Tries
        :meth:`Context.lookup_default` first, then the local default.
 
        :param ctx: Current context.
        :param call: If the default is a callable, call it. Disable to
            return the callable instead.
 
        .. versionchanged:: 8.0.2
            Type casting is no longer performed when getting a default.
 
        .. versionchanged:: 8.0.1
            Type casting can fail in resilient parsing mode. Invalid
            defaults will not prevent showing help text.
 
        .. versionchanged:: 8.0
            Looks at ``ctx.default_map`` first.
 
        .. versionchanged:: 8.0
            Added the ``call`` parameter.
        F©r¹N)r»r9rŸr¼)rr.r¹r½r:r:r;rÑ¿s  ©rEr.r0cCs
tƒ‚dSrJrô©rrEr.r:r:r;rDàszParameter.add_to_parser©r.r<r0cCsd| |j¡}tj}|dkr*| |¡}tj}|dkrD| |j¡}tj}|dkr\| |¡}tj    }||fSrJ)
r‰r9rdrjÚvalue_from_envvarrkr»rmrÑrl©rr.r<r½rÕr:r:r;Ú consume_valueãs 
 
zParameter.consume_value)r.r½r0csÚ|dkr ˆjsˆjdkrdSdStjtjtjdœ‡‡fdd„ ‰ˆjdksRˆjjrntjtjdœ‡‡fdd    „ ‰nDˆjdkr–tjtjdœ‡‡‡fd
d    „ ‰ntjtjdœ‡‡‡fd d    „ ‰ˆjrÒt‡fd d „ˆ|ƒDƒƒSˆ|ƒS)zuConvert and validate a value against the option's
        :attr:`type`, :attr:`multiple`, and :attr:`nargs`.
        Néÿÿÿÿr:r~cs8z
t|ƒWStk
r2ttdƒˆˆdd‚YnXdS)NzValue must be an iterable.©r.rP)rrÎrr€rr€r:r;Ú
check_iterþs
ÿþz-Parameter.type_cast_value.<locals>.check_iterr
csˆj|ˆˆdS)N)rPr.©rDrr€r:r;Úconvert     sz*Parameter.type_cast_value.<locals>.convertcst‡‡fdd„ˆ|ƒDƒƒS)Nc3s|]}ˆ |ˆˆ¡VqdSrJr¿©rÚxr€r:r;r    sú=Parameter.type_cast_value.<locals>.convert.<locals>.<genexpr>)Útupler©r¾r.rr:r;rÀ    scs\tˆ|ƒƒ}t|ƒˆjkrDttddt|ƒƒjˆjt|ƒdˆˆd‚t‡‡fdd„|DƒƒS)Nz%Takes {nargs} values but 1 was given.z*Takes {nargs} values but {len} were given.)r r_r½c3s|]}ˆ |ˆˆ¡VqdSrJr¿rÁr€r:r;r#    srÃ)rÄr_r rrrOrrÅr:r;rÀ    s ýüù
c3s|]}ˆ|ƒVqdSrJr:rÁ)rÀr:r;r&    sz,Parameter.type_cast_value.<locals>.<genexpr>)rer r1rÜrãrDr¦rÄ©rr.r½r:)r¾rÀr.rr;rÐ÷s  
zParameter.type_cast_valuer~cCs,|dkr dS|jdks|jr(|dkr(dSdS)NTr
r:F)r re)rr½r:r:r;Úvalue_is_missing*    s
zParameter.value_is_missingcCsD| ||¡}|jr(| |¡r(t||d‚|jdk    r@| |||¡}|S)Nr½)rÐrmrÇrr¨rÆr:r:r;Ú process_value3    s   
zParameter.process_valuerëcCsZ|jdkrdSt|jtƒr2tj |j¡}|rV|Sn$|jD]}tj |¡}|r8|Sq8dSrJ)r¢rBrÛrrr‰©rr.ržr¢r:r:r;Úresolve_envvar_value>    s
 
 
zParameter.resolve_envvar_valuecCs,| |¡}|dk    r(|jdkr(|j |¡}|Sr•)rÊr rDÚsplit_envvar_valuerpr:r:r;r¹P    s
 zParameter.value_from_envvar)r.r<rƒr0c    Cs‚t||dV| ||¡\}}| |j|¡z| ||¡}Wn tk
r\|jsT‚d}YnXW5QRX|jrz||j|j<||fS)N)rP)    rRr»rÖr9rÈÚ    ExceptionrwrÏr‚)rr.r<rƒr½rÕr:r:r;r^X    s zParameter.handle_parse_resultcCsdSrJr:rír:r:r;rZl    szParameter.get_help_recordcCsgSrJr:rír:r:r;r¯o    szParameter.get_usage_piecescCs"|jp |jg}d dd„|Dƒ¡S)z{Get a stringified version of the param for use in error messages to
        indicate which param caused the error.
        ú / css|]}d|›dVqdS)ú'Nr:rÁr:r:r;rw    sz+Parameter.get_error_hint.<locals>.<genexpr>)r<r¯r°)rr.Z    hint_listr:r:r;Úget_error_hintr    szParameter.get_error_hintr-csj|jdk    rZ| |||¡}|rHt|dtƒrHddlm‰‡fdd„|Dƒ}t tjd|¡S|j     |||¡S)aReturn a list of completions for the incomplete value. If a
        ``shell_complete`` function was given during init, it is used.
        Otherwise, the :attr:`type`
        :meth:`~click.types.ParamType.shell_complete` function is used.
 
        :param ctx: Invocation context for this command.
        :param incomplete: Value being completed. May be empty.
 
        .. versionadded:: 8.0
        Nrr&csg|] }ˆ|ƒ‘qSr:r:rŠr&r:r;r.Š    sz,Parameter.shell_complete.<locals>.<listcomp>r')
r¨rBrÛrr'r1r2rßrDrrr:r&r;ry    s
 zParameter.shell_complete) NNFNNNFNTFNN)T).)T),rErerfrgr¬r1rÚr$rÛrçr Ú    ParamTyperÜraràr+rÞrßr‘rár“rór`r¤rär¯r²rærÑrrDÚMappingrdr»rÐrÇrÈrÊr¹r^rZr¯rÏrr:r:r:r;rOÜs¦Iî ÿÿÿí X þ ÿ
þÿ þÿ þ !þ 3         þ  cs*eZdZdZdZd&ejejeej    e
edfej    e
efej    e
efe
e
eje
ejej e
e
e
ejej    e j ej fejee
e
e
ej ddœ‡fdd„ Zejeej fd    œ‡fd
d „ Zejee
ejejeejeejefd œd d„Zeeddœdd„Zeejejeefdœdd„Zejd'edejej dœdd„ƒZejd(ee
ejej    ej ejgej ffdœdd„ƒZd)ee
ejej    ej ejgej ffdœ‡fdd„ Zeej dœdd„Zeejedœ‡fdd„ Zeejej dœd d!„Zeejed"fejej efd#œ‡fd$d%„ Z ‡Z!S)*r?aÖ Options are usually optional values on the command line and
    have some extra features that arguments don't have.
 
    All other parameters are passed onwards to the parameter constructor.
 
    :param show_default: Show the default value for this option in its
        help text. Values are not shown by default, unless
        :attr:`Context.show_default` is ``True``. If this value is a
        string, it shows that string in parentheses instead of the
        actual value. This is particularly useful for dynamic options.
        For single option boolean flags, the default remains hidden if
        its value is ``False``.
    :param show_envvar: Controls if an environment variable should be
        shown on the help page. Normally, environment variables are not
        shown.
    :param prompt: If set to ``True`` or a non empty string then the
        user will be prompted for input. If set to ``True`` the prompt
        will be the option name capitalized.
    :param confirmation_prompt: Prompt a second time to confirm the
        value if it was prompted for. Can be set to a string instead of
        ``True`` to customize the message.
    :param prompt_required: If set to ``False``, the user will be
        prompted for input only when the option was specified as a flag
        without a value.
    :param hide_input: If this is ``True`` then the input on the prompt
        will be hidden from the user. This is useful for password input.
    :param is_flag: forces this option to act as a flag.  The default is
                    auto detection.
    :param flag_value: which value should be used for this flag if it's
                       enabled.  This is set to a boolean automatically if
                       the option string contains a slash to mark two options.
    :param multiple: if this is set to `True` then the argument is accepted
                     multiple times and recorded.  This is similar to ``nargs``
                     in how it works but supports arbitrary number of
                     arguments.
    :param count: this flag makes an option increment an integer.
    :param allow_from_autoenv: if this is enabled then the value of this
                               parameter will be pulled from an environment
                               variable in case a prefix is defined on the
                               context.
    :param help: the help string.
    :param hidden: hide this option from help outputs.
    :param attrs: Other command arguments described in :class:`Parameter`.
 
    .. versionchanged:: 8.1.0
        Help text indentation is cleaned here instead of only in the
        ``@option`` decorator.
 
    .. versionchanged:: 8.1.0
        The ``show_default`` parameter overrides
        ``Context.show_default``.
 
    .. versionchanged:: 8.1.0
        The default of a single option boolean flag is not shown if the
        default value is ``False``.
 
    .. versionchanged:: 8.0.1
        ``type`` is detected from ``flag_value`` if given.
    ÚoptionNFT)ržr~rÚconfirmation_promptÚprompt_requiredÚ
hide_inputrBÚ
flag_valuereÚcountÚallow_from_autoenvrDrþr8Ú show_choicesÚ show_envvarrjr0c sT| rt | ¡} d|k}tƒj|f| |    dœ|—Ž|dkr^|jdkrJtdƒ‚|j dd¡ ¡}n|dkrld}n|}||_||_    ||_
||_ ||_ |jdk    ož|j
|_ |dkrÐ|dk    r¸d}qè|j rÄd}qèt|jƒ}n|dkrè|j sè|dk    |_ ||r|r|js|    rd|_nd|_|dkr&|j }||rH| dkrHt d|¡|_||_|o`t|jtjƒ|_||_|
|_|
rš| dkrŽtjd    d
|_|ršd    |_| |_| |_||_||_||_ |j!d krÌtd ƒ‚|jrì|jrì|jsìtd ƒ‚|js|jrtdƒ‚|jr(|j r(|jdk    r(tdƒ‚|jrP|j"r@tdƒ‚|jrPtdƒ‚dS)NrŸ)rDreTz&'name' is required with 'prompt=True'.r€r«Fr:r)Úminr¼z&nargs=-1 is not supported for options.z+'prompt' is not valid for non-boolean flag.z1Secondary flag is not valid for non-boolean flag.z9'prompt' with 'hide_input' is not valid for boolean flag.z%'count' is not valid with 'multiple'.z$'count' is not valid with 'is_flag'.)#rMrNr,r‘r9rÎrŒÚ
capitalizerrÓrÔrÕr8rrar=rmrŸr r¥rDrBrBZ BoolParamTypeÚ is_bool_flagrÖr×ZIntRangerØrþr~rÙrÚr re)rržr~rrÓrÔrÕrBrÖrer×rØrDrþr8rÙrÚrjZdefault_is_missingZ prompt_textr-r:r;r‘Р   s€
 
 
 
 
 ÿzOption.__init__r’cs0tƒ ¡}|j|j|j|j|j|j|jd|S)N)rþrrBrÖr×r8)    r,r“rÒrþrrBrÖr×r8)rr/r-r:r;r“F
s
úzOption.to_info_dictr­c Cstg}g}d}g}|D]Ê}| ¡r>|dk    r8td|›dƒ‚|}q|dd…dkrRdnd}||krÆ| |d¡\}    }
|     ¡}    |    r’| t|    ƒ¡| |    ¡|
 ¡}
|
r¬| |
 ¡¡|    |
krÞtd|›dƒ‚q| t|ƒ¡| |¡q|dkr&|r&|jdd    „d
|d d     d d ¡ 
¡}| ¡s&d}|dkrH|s@d||fStdƒ‚|sj|sjtd|›d|›dƒ‚|||fS)NzName 'z' defined twicer
ú/ú;zBoolean option z) cannot use the same flag for true/false.cSst|dƒ S)Nrrx©rÂr:r:r;Ú<lambda>t
óz%Option._parse_decls.<locals>.<lambda>r^rrr€z#Could not determine name for optionz*No options defined but a name was passed (zH). Did you mean to declare an argument instead? Did you mean to pass '--z'?) Ú isidentifierrÎÚsplitr3r[rr±rXÚsortrŒÚlower) rr®rÏr<r=r9Zpossible_namesÚdeclZ
split_charÚfirstÚsecondr:r:r;r¤R
sN
 
ÿ 
 
 
 ÿzOption._parse_declsr¶cCs¤|jr d}n|jrd}nd}|jr†|›d}|jrj|jrj|j||j|j|dd|j||j|j|ddq |j||j|j||jdn|j||j|j||j    ddS)    Nr[r×ÚstoreZ_constT)rrr<ÚdestÚactionÚconstF)rrr<rërìr )
rer×rBrÝr=Ú
add_optionr<r9rÖr )rrEr.rìr:r:r;rD‡
sH
 ÿûûûzOption.add_to_parserrëcsÔˆjr
dSd‰tjttdœ‡‡fdd„ }|ˆjƒg}ˆjrL| |ˆjƒ¡ˆjpTd}g}ˆjrވj    }|dkržˆj
rž|j dk    ržˆj dk    rž|j ›dˆj   ¡›}|dk    rÞt|tƒr´|nd dd    „|Dƒ¡}| td
ƒj|d ¡|j}d |_zˆj|dd }    W5||_Xd}
d} ˆjdk    r:tˆjtƒr2d } }
nˆj}
n|jdk    rL|j}
| sb|
r&|    dk    r&| rxdˆj›d} n’t|    ttfƒržd dd    „|    Dƒ¡} nlt |    ¡r´tdƒ} nVˆjræˆjrætˆjrԈjnˆjdƒd} n$ˆjrˆjs|    sd} nt|    ƒ} | r&| tdƒj| d¡tˆjtjƒrtˆjrZˆjj dkrZˆjj!dkstˆj "¡} | rt| | ¡ˆj#rŠ| tdƒ¡|r¼d |¡}|r°|›d|›dn
d|›d}ˆrÆdnd |¡|fS)NF)r<r0cs6t|ƒ\}}|rd‰ˆjs2ˆjs2|dˆ ¡›7}|S)NTr«)rrBr×r²)r<ržZ any_slashes©Zany_prefix_is_slashrr:r;Ú _write_opts´
s   z+Option.get_help_record.<locals>._write_optsrªr€z, css|]}t|ƒVqdSrJ©rÛ©rÚdr:r:r;rØ
sz)Option.get_help_record.<locals>.<genexpr>zenv var: {var})ÚvarTrµú(ú)css|]}t|ƒVqdSrJrñròr:r:r;rö
sz    (dynamic)rr
zdefault: {default})rŸrmz; z  [ú]ú[rÍ)$r8r1r$rÛr<r=r[rþrÚr¢rØrsr9r‹rBr°r€rOrwrÑr~rKrÄrMÚ
isfunctionrÝrrŸrDr Z_NumberRangeBaser×rÛrzZ_describe_rangerm)rr.rðržrþrör¢Zvar_strZ    resilientÚ default_valuer~Zshow_default_is_strZdefault_stringZ    range_strZ    extra_strr:rïr;rZ®
s’ 
ÿþýÿý 
 
ÿþ ÿý
ý
ý
 
 
"zOption.get_help_recordr¸r³cCsdSrJr:r´r:r:r;rÑ szOption.get_default.cCsdSrJr:r´r:r:r;rÑ  scsR|jrB|jsB|jjD](}|j|jkr|jrt t|¡j    SqdSt
ƒj ||dS)Nrµ) rBrÝr4r‚r9rŸr1r2r?rÖr,rÑ)rr.r¹rPr-r:r;rÑ& s   c
sTˆjdk    st‚ˆ ˆ¡}ˆjr*tˆj|ƒStˆj|ˆjˆjˆjˆj‡‡fdd„dS)zîThis is an alternative flow that can be activated in the full
        value processing if a value does not exist.  It will prompt the
        user until a valid value exists and then returns the processed
        value as result.
        Ncs ˆ ˆ|¡SrJ)rÈràr€r:r;ráM râz)Option.prompt_for_value.<locals>.<lambda>)rŸrDrÕrÙrÓZ
value_proc)    rr„rÑrÝrrDrÕrÙrÓ)rr.rŸr:r€r;Úprompt_for_value6 s
  ùzOption.prompt_for_valuecs`tƒ |¡}|dk    r|S|jr\|jdk    r\|jdk    r\|j›d|j ¡›}tj |¡}|r\|SdS)Nr€)    r,rÊrØrsr9r‹rrr‰rÉr-r:r;rÊP s ÿþý zOption.resolve_envvar_valuecCs^| |¡}|dkrdS|jdkt|jƒ}|dkrZ|j |¡}|jrZ|jdkrZt||jƒ}|Srš)rÊr rarerDrËrN)rr.ržZ value_depthr:r:r;r¹c s
  zOption.value_from_envvarrOr¸csÆtƒ ||¡\}}|tkrJˆjdk    r<|js<ˆ |¡}tj}q¾ˆj}tj    }ntˆj
r„|dk    r„t dd„|Dƒƒr„‡fdd„|Dƒ}tj    }n:|dtj hkr¾ˆjdk    r¾ˆj s¨ˆjr¾|js¾ˆ |¡}tj}||fS)Ncss|]}|tkVqdSrJr©rÚvr:r:r;r† sz'Option.consume_value.<locals>.<genexpr>csg|]}|tkrˆjn|‘qSr:)rrÖrür”r:r;r.ˆ sz(Option.consume_value.<locals>.<listcomp>)r,r»rrrwrûrdrnrÖrjreÚanyrlrmrÔrºr-r”r;r»s s8
ÿþý ÿþýýü
zOption.consume_value)NNFFTFNNFFTNNFTF)T).)T)"rErerfrgr¬r1rÚr$rÛrçrarÜr rÐr‘rár“r`rßr¤rr+rDrZrærÑràrûrÊr¹rÑrdr»rfr:r:r-r;r?‘    s<ï  
ív  þ 5' lÿ
þÿ þÿ þ þr?csÎeZdZdZdZdejeeje    ej
ddœ‡fdd„ Z e edœdd    „ƒZ edœd
d „Zejee    ejejeejeejefd œd d„Zeejedœdd„Zeedœdd„Zeeddœdd„Z‡ZS)rlaArguments 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`.
    ZargumentN)ržrmrjr0c st|dkr,| d¡dk    rd}n| dd¡dk}d|kr<tdƒ‚tƒj|fd|i|—Ž|jdk    rp|jd    krptd
ƒ‚dS) NrŸFr r
rrez9__init__() got an unexpected keyword argument 'multiple'.rmr¼z('default' is not supported for nargs=-1.)r‰rÎr,r‘rŸr )rržrmrjr-r:r;r‘£ szArgument.__init__r’cCs|jdk    r|jS|j ¡SrJ)r¡r9r‹r”r:r:r;r¯¸ s
zArgument.human_readable_namecCsR|jdk    r|jS|j |¡}|s*|j ¡}|js<d|›d}|jdkrN|d7}|S)Nrør÷r
r°)r¡rDr±r9r‹rmr )rrôr:r:r;r²¾ s
 
 
zArgument.make_metavarr­cCsd|s|sdggfStdƒ‚t|ƒdkrD|d}}| dd¡ ¡}ntdt|ƒ›dƒ‚||ggfS)Nz%Could not determine name for argumentr
rrr€z6Arguments take exactly one parameter declaration, got r)rÎr_rŒræ)rr®rÏr9Úargr:r:r;r¤Ê s
  ÿzArgument._parse_declsrëcCs
| ¡gSrJ©r²rír:r:r;r¯Û szArgument.get_usage_piecescCsd| ¡›dS)NrÎrrír:r:r;rÏÞ szArgument.get_error_hintr¶cCs|j|j|j|ddS)N)rër rr)Ú add_argumentr9r r·r:r:r;rDá szArgument.add_to_parser)N)rErerfrgr¬r1r$rÛrÚrarÜr‘rär¯r²r`rßr¤r+r¯rÏrrDrfr:r:r-r;rl™ s&ýû  þ rl)F)N)VrhrrMrrÚtypingr1Ú collectionsrÚ
contextlibrrÚ    functoolsrrr€rÚ    itertoolsrr r    rªÚ
exceptionsr rrrrrZ
formattingrrÚglobalsrrrErrrZtermuirrrÚutilsr r!r"r#r$r%Ú TYPE_CHECKINGZtyping_extensionsÚter r'ÚTypeVarràrÜr(r*rÛrãr`r<rarGÚIterablerÞrßrNrÚrRr$rcÚEnumrdr+rèr,r3r‡r™rrOr?rlr:r:r:r;Ú<module>s¾                                
þ ÿþ (ÿþý 'H:71-
8