Skip to content
Myr

Docs: docstring fixes

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

authored by Julen Ruiz Aizpuru · committed by Julen Ruiz Aizpuru · parent aed87f0 · Browse files · 2 files+11 added−11 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+11 added−11 removed

  • other:+11 added−11 removed

2 files+11 added−11 removed

modified:click/core.py+10 added-10 removed
252 unmodified lines
253254class Command(object):255 """Commands are the basic building block of command line interfaces in256 click. A basic command handles command line parsing and might dispatch257 more parsing to commands nested blow it.257 more parsing to commands nested below it.258259 :param name: the name of the command to use unless a group overrides it.260 :param callback: the callback to invoke. This is optional.261 :param params: the parameters to register with this command. This can
10 unmodified lines
272273 def __init__(self, name, callback=None, params=None, help=None,274 epilog=None, short_help=None,275 options_metavar='[OPTIONS]', add_help_option=True):276 #: the name the command things it has. Upon registering a command276 #: the name the command thinks it has. Upon registering a command277 #: on a :class:`Group` the group will default the command name278 #: with this information. You should instead use the279 #: :class:`Context`\'s :attr:`~Context.info_name` attribute.280 self.name = name
95 unmodified lines
376 invoke the actual command callback though.377378 :param info_name: the info name for this invokation. Generally this379 is the most descriptive name for the script or380 command. For the toplevel script is is usually380 command. For the toplevel script it's usually381 the name of the script, for commands below it it's382 the name of the script.383 :param args: the arguments to parse as list of strings.384 :param parent: the parent context if available.
35 unmodified lines
420 ctx.invoke(self.callback, **ctx.params)421422 def main(self, args=None, prog_name=None, **extra):423 """This is the way to invoke a script with all the bells and424 whistles as command line application. This will always terminate425 the application after calling. If this is not wanted, ``SystemExit``424 whistles as a command line application. This will always terminate425 the application after a call. If this is not wanted, ``SystemExit``426 needs to be caught.427428 This method is also available by directly calling the instance of429 a :class:`Command`.430431 :param args: the arguments that should be used for parsing. If not432 provided, ``sys.argv[1:]`` is used.433 :param prog_name: the program name that should be used. By default434 the progam name is constructed by taking the file434 the program name is constructed by taking the file435 name from ``sys.argv[0]``.436 :param extra: extra keyword arguments are forwarded to the context437 constructor. See :class:`Context` for more information.438 """
244 unmodified lines
683 :param param_decls: the parameter declarations for this option or684 argument. This is a list of flags or argument685 names.686 :param type: the type that should be used. Either a :class:`ParamType`687 or a python type. The latter is converted into the former687 or a python type. The later is converted into the former688 automatically if supported.689 :param required: controls if this is optional or not.690 :param default: the default value if omitted. This can also be a callable691 in which case it's invoked when the default is needed
143 unmodified lines
835 auto detection.836 :param flag_value: which value should be used for this flag if it's837 enabled. This is set to a boolean automatically if838 the option string contains a slash to mark two options.839 :param multiple: if this is set to True then the argument is accepted840 multiple times and recorded. This is similar to nargs839 :param multiple: if this is set to `True` then the argument is accepted840 multiple times and recorded. This is similar to ``nargs``841 in how it works but supports arbitrary number of842 arguments.843 :param count: this flag makes an option increment an integer843 :param count: this flag makes an option increment an integer.844 :param allow_from_autoenv: if this is enabled then the value of this845 parameter will be pulled from an environment846 variable in case a prefix is defined on the847 context.
252 unmodified lines
modified:click/decorators.py+1 added-1 removed
85 unmodified lines
8687def command(name=None, cls=None, **attrs):88 """Creates a new :class:`Command` and uses the decorated function as89 callback. This will also automatically attach all decorated90 :func:`option`\s and :func:`argument`\s as paramters to the command.90 :func:`option`\s and :func:`argument`\s as parameters to the command.9192 The name of the command defaults to the name of the function. If you93 want to change that, you can pass the intended name as the first94 argument.
193 unmodified lines