You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you please explain your overall reasoning? Maybe I am misunderstanding, but couldn't you do this -
@click.command()
@click.option('--color', multiple=True, metavar='<COLOR>', help='Specify a color')
@click.option('--size', multiple=True, metavar='<SIZE>', help='Specify a size')
def cli(color, size):
click.echo(f'You selected the colors: {", ".join(color)}')
click.echo(f'You selected the sizes: {", ".join(size)}')
if __name__ == '__main__':
cli()
Then you would get -
$ python script.py --color red --color green --color blue --size small --size large
You selected the colors: red, green, blue
You selected the sizes: small, large
I think it would be nice to append a
...
to the metavar whenmultiple
is true. Using curl as an example,-H TEXT
would become-H TEXT...
.The text was updated successfully, but these errors were encountered: