Skip to content

Commit

Permalink
for pallets#1287: allow bool type with bool flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kporangehat committed May 6, 2019
1 parent c6042bf commit 9f1fe78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions click/core.py
Expand Up @@ -1570,7 +1570,7 @@ def __init__(self, param_decls=None, show_default=False,
self.is_flag = is_flag
self.flag_value = flag_value
if self.is_flag and isinstance(self.flag_value, bool) \
and type is None:
and type in [None, bool]:
self.type = BOOL
self.is_bool_flag = True
else:
Expand Down Expand Up @@ -1733,7 +1733,7 @@ def _write_opts(opts):
return ((any_prefix_is_slash and '; ' or ' / ').join(rv), help)

def get_default(self, ctx):
# If we're a non boolean flag out default is more complex because
# If we're a non boolean flag our default is more complex because
# we need to look at all flags in the same group to figure out
# if we're the the default one in which case we return the flag
# value as default.
Expand Down

0 comments on commit 9f1fe78

Please sign in to comment.