Skip to content
Myr

Hide defaults by default on help page

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 6fbfd77 · Browse files · 1 file+3 added−5 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+3 added−5 removed

  • other:+3 added−5 removed

1 file+3 added−5 removed

modified:click/core.py+3 added-5 removed
799 unmodified lines
800801 All other parameters are passed onwards to the parameter constructor.802803 :param show_default: controls if the default value should be shown on the804 help page. The default is auto detection.804 help page. Normally defaults are not shown.805 :param prompt: if set to `True` or a non empty string then the user will806 be prompted for input if not set. If set to `True` the807 prompt will be the option name capitalized.808 :param confirmation_prompt: if set then the value will need to be confirmed
18 unmodified lines
827 :param help: the help string.828 """829 param_type_name = 'option'830831 def __init__(self, param_decls=None, show_default=None,831 def __init__(self, param_decls=None, show_default=False,832 prompt=False, confirmation_prompt=False,833 hide_input=False, is_flag=None, flag_value=None,834 multiple=False, count=False, allow_from_autoenv=True,835 type=None, help=None, **attrs):
16 unmodified lines
852 is_flag = bool(self.secondary_opts)853854 if is_flag and default_is_missing:855 self.default = False856 if show_default is None:857 show_default = False856857 if flag_value is None:858 flag_value = not self.default859862 self.show_default = show_default860 self.is_flag = is_flag861 self.flag_value = flag_value862 self.multiple = multiple863
9 unmodified lines
873 self.is_bool_flag = False874875 self.allow_from_autoenv = allow_from_autoenv876 self.help = help877 self.show_default = show_default878879 # Sanity check for stuff we don't support880 if __debug__:881 if self.prompt and self.is_flag and not self.is_bool_flag:
194 unmodified lines