Moved help arg from parameter to option
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 · parent fe262a9 · Browse files · 1 file·+5 added−6 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+5 added−6 removed
- other:+5 added−6 removed
Provenance
- Commit
5fb4c01- Tree
81dbe7b- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
fe262a9
1 file changed+5 added−6 removed
modified:click/core.py+5 added-6 removed
515 unmodified lines516 :param required: controls if this is optional or not.517 :param default: the default value if omitted. This can also be a callable518 in which case it's invoked when the default is needed519 without any arguments.520- :param help: the help string.520 :param callback: a callback that should be executed after the parameter521 was matched. This is called as ``fn(ctx, value)`` and522 needs to return the value.523 :param nargs: the number of arguments to match. If not ``1`` the return10 unmodified lines534 """535 param_type_name = 'parameter'536 537 def __init__(self, param_decls=None, type=None, required=False,539- default=None, help=None, callback=None, nargs=1,540- metavar=None, expose_value=True, is_eager=False,541- envvar=None):538+ default=None, callback=None, nargs=1, metavar=None,539+ expose_value=True, is_eager=False, envvar=None):540 self.name, self.opts, self.secondary_opts = \541 self._parse_decls(param_decls or ())542 self.type = convert_type(type, default)543 self.required = required546- self.help = help544 self.callback = callback545 self.nargs = nargs546 self.multiple = False547 self.expose_value = expose_value105 unmodified lines653 :param allow_from_autoenv: if this is enabled then the value of this654 parameter will be pulled from an environment655 variable in case a prefix is defined on the656 context.657+ :param help: the help string.658 """659 param_type_name = 'option'660 661 def __init__(self, param_decls=None, show_default=None,662 prompt=False, confirmation_prompt=False,663 hide_input=False, is_flag=None, flag_value=None,664 multiple=False, allow_from_autoenv=True, type=None,667- **attrs):665+ help=None, **attrs):666 default_is_missing = attrs.get('default', _missing) is _missing667 Parameter.__init__(self, param_decls, type=type, **attrs)668 if prompt is True:669 prompt_text = self.name.replace('_', ' ').capitalize()31 unmodified lines701 else:702 self.is_bool_flag = False703 704 self.allow_from_autoenv = allow_from_autoenv705+ self.help = help706 707 # Sanity check for stuff we don't support708 if __debug__:709 if self.prompt and self.is_flag and not self.is_bool_flag:193 unmodified lines