-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Milestone
Description
The following example combines optional values with multiple options:
#!/usr/bin/env python3
import click
@click.command()
@click.option('--label', multiple=True, is_flag=False, flag_value='default')
def cli(label):
print(label)
print(f"click.core._flag_needs_value: {click.core._flag_needs_value}")
cli()$ ./test.py --label --label test
('<object object at 0x7f5ef63ec250>', 'test')
click.core._flag_needs_value: <object object at 0x7f5ef63ec250>
Expected result: ('default', 'test')
Looks like when multiple=True, the sentinel value (click.core._flag_needs_value) is never substituted with the default value specified by flag_value.
Environment:
- Python version: 3.7.3
- Click version: 8.0.1
Metadata
Metadata
Assignees
Labels
No labels