Merge pull request #83 from julen/doc-fixes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parents aed87f0, 9659523 · 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.
Trailers
- Docs: docstring fixes
Diff stats
2 files+11 added−11 removed
- other:+11 added−11 removed
Provenance
- Commit
e4d700e- Tree
6369e44- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
aed87f0- Parent 2
9659523
2 files changed+11 added−11 removed
modified:click/core.py+10 added-10 removed
252 unmodified lines253 254 class 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.258 259 :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 can10 unmodified lines272 273 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 = name95 unmodified lines376 invoke the actual command callback though.377 378 :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 lines420 ctx.invoke(self.callback, **ctx.params)421 422 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.427 428 This method is also available by directly calling the instance of429 a :class:`Command`.430 431 :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 lines683 :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 needed143 unmodified lines835 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 linesmodified:click/decorators.py+1 added-1 removed
85 unmodified lines86 87 def 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.91 92 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