I use click
like this:
import click
@click.command(name='foo')
@click.option('--bar', required=True)
def do_something(bar):
print(bar)
So the name of the option and the name of the function parameter is the same. When it is not the same (e.g. when you want --id
instead of --bar
), I get:
TypeError: do_something() got an unexpected keyword argument 'id'
I don't want the parameter to be called id
because that is a Python function. I don't want the CLI parameter to be called different, because it would be more cumbersome / less intuitive. How can I fix it?