I'm having some trouble with my callback function. In the rest of the foo function, I use both the foo and type variable, but am unable to retrieve the type variable since the order of execution matters as shown below. Is there any way to disregard the order of execution, or is there a different way to go about it?
Click option
@click.option('-f', '--foo', callback=validate_foo)
@click.option('-t', '--type')
def validate_foo(ctx, param, foo):
type = ctx.params.get('type')
click.echo(f'type: {type}')
Output:
python test.py -t typetest -f footest command
type: typetest
python test.py -f footest -t typetest command
type: None
Thank you!