Skip to content
Myr

Docs: add references for varargs and kwargs (#2281)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Blazej Michalik · committed by GitHub · parent 8473b3c · Browse files · 2 files+18 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+18 added−1 removed

  • other:+18 added−1 removed

2 files+18 added−1 removed

modified:src/click/core.py+6 added-1 removed
1478 unmodified lines
1479 multiple commands to be chained together.1480 :param result_callback: The result callback to attach to this multi1481 command. This can be set or changed later with the1482 :meth:`result_callback` decorator.1483 :param attrs: Other command arguments described in :class:`Command`.1484 """14851486 allow_extra_args = True1487 allow_interspersed_args = False
458 unmodified lines
1946 """A command collection is a multi command that merges multiple multi1947 commands together into one. This is a straightforward implementation1948 that accepts a list of different multi commands as sources and1949 provides all the commands for each of them.19501951 See :class:`MultiCommand` and :class:`Command` for the description of1952 ``name`` and ``attrs``.1953 """19541955 def __init__(1956 self,
515 unmodified lines
2472 variable in case a prefix is defined on the2473 context.2474 :param help: the help string.2475 :param hidden: hide this option from help outputs.2476 :param attrs: Other command arguments described in :class:`Parameter`.24772478 .. versionchanged:: 8.1.02479 Help text indentation is cleaned here instead of only in the2480 ``@option`` decorator.
470 unmodified lines
2951 """Arguments are positional parameters to a command. They generally2952 provide fewer features than options but can have infinite ``nargs``2953 and are required by default.29542950 All parameters are passed onwards to the parameter constructor.2955 All parameters are passed onwards to the constructor of :class:`Parameter`.2956 """29572958 param_type_name = "argument"2959
64 unmodified lines
modified:src/click/decorators.py+12 added
334 unmodified lines
335 arguments are forwarded unchanged (except ``cls``).336 This is equivalent to creating an :class:`Argument` instance manually337 and attaching it to the :attr:`Command.params` list.338339 For the default argument class, refer to :class:`Argument` and340 :class:`Parameter` for descriptions of parameters.341342 :param cls: the argument class to instantiate. This defaults to343 :class:`Argument`.344 :param param_decls: Passed as positional arguments to the constructor of345 ``cls``.346 :param attrs: Passed as keyword arguments to the constructor of ``cls``.347 """348349 def decorator(f: FC) -> FC:350 ArgumentClass = attrs.pop("cls", None) or Argument
9 unmodified lines
360 arguments are forwarded unchanged (except ``cls``).361 This is equivalent to creating an :class:`Option` instance manually362 and attaching it to the :attr:`Command.params` list.363364 For the default option class, refer to :class:`Option` and365 :class:`Parameter` for descriptions of parameters.366367 :param cls: the option class to instantiate. This defaults to368 :class:`Option`.369 :param param_decls: Passed as positional arguments to the constructor of370 ``cls``.371 :param attrs: Passed as keyword arguments to the constructor of ``cls``.372 """373374 def decorator(f: FC) -> FC:375 # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
192 unmodified lines