-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Milestone
Description
This is relevant only for Click 8.0.1, since the following line was introduced in PR #1913:
Line 2531 in af0af57
| self.is_bool_flag = isinstance(self.type, types.BoolParamType) |
The solution is as easy as:
self.is_bool_flag = self.is_flag and isinstance(self.type, types.BoolParamType)Available to open a PR.
Demonstration code
import click
@click.command()
@click.option('--switch', type=bool)
def f(switch):
print(switch)
if __name__ == '__main__':
assert not f.params[0].is_flag
assert f.params[0].is_bool_flag
f('--switch'.split())Error: Option '--switch' requires an argument.
Metadata
Metadata
Assignees
Labels
No labels