-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Labels
Description
Outline
As stated in official documentation:
Setting
is_flag=False, flag_value=valuetells Click that the option can still be passed a value, but if only the flag is given, the value will beflag_value.
Since 8.3.0 this doesn't work anymore, instead SystemExit with "Error: Option '--xyz' requires an argument." is thrown.
Replication of bug
Example taken from documentation:
@click.command()
@click.option("--name", is_flag=False, flag_value="Flag", default="Default")
def hello(name):
click.echo(f"Hello, {name}!")$ hello --name
Error: Option '--name' requires an argument.Expected behavior
The code example above should work as
$ hello --name
Hello, Flag!It's not even working in the generated documentation anymore: while documentation up to Sep, 10th shows the expected and correct behavior, current documentation demonstrates the bug.
- Python version: 3.11
- Click version: 8.3.0
Reactions are currently unavailable