Skip to content
Myr

Allow to set defaults for bools to None

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 8f7caca · Browse files · 1 file+4 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

1 file+4 added−1 removed

  • other:+4 added−1 removed

1 file+4 added−1 removed

modified:click/core.py+4 added-1 removed
7 unmodified lines
8from .helpers import prompt, confirm910from . import _optparse1112_missing = object()131415class Context(object):16 """The context is a special internal object that holds state relevant17 for the script execution at every single level. It's normally invisible18 to commands unless they opt-in to getting access to it.
597 unmodified lines
616 prompt=False, confirmation_prompt=False,617 hide_input=False, is_flag=None, flag_value=None,618 multiple=False, allow_from_autoenv=True, type=None,619 **attrs):620 default_is_missing = attrs.get('default', _missing) is _missing621 Parameter.__init__(self, param_decls, type=type, **attrs)622 if prompt is True:623 prompt_text = self.name.replace('_', ' ').capitalize()624 elif prompt is False:
9 unmodified lines
634 is_flag = True635 else:636 is_flag = bool(self.secondary_opts)637635 if is_flag and self.default is None:638 if is_flag and default_is_missing:639 self.default = False640 if show_default is None:641 show_default = False642
213 unmodified lines