Arguments of type 'click.Choice' are properly constrained on invocation, but do not show up in bash tab completion.
dws.py:
...
SETTINGS = [
"auto_start",
"disk_size",
"environment"
]
@click.group()
def cli():
pass
@cli.command()
@click.argument('setting', type=click.Choice(SETTINGS), nargs=1)
@click.argument('value', nargs=1)
def set(setting, value):
'''
Persists a named setting. Supported settings:
["environment", "add_to_chef"]
'''
click.echo("Persisting a setting: %s=%s" % (setting, value))
...
dws <tab> <tab> reveals the set function as expected, but not the allowable values from the SETTINGS list.
The current click bashcompletion doesn't do any kind of completion of the _values_ of options and arguments.
Is there any plan to incorporate this feature? I'd be very interested in this.
Most helpful comment
Is there any plan to incorporate this feature? I'd be very interested in this.