diff --git a/click/core.py b/click/core.py index 7a1e3422b..8b7b79527 100644 --- a/click/core.py +++ b/click/core.py @@ -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: @@ -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.