How to check all at once what arguments are entered/passed in the CLI from users, so I can retrieve those passed parameters and feed it into my function for other tasks. It's is very inconvenient at the moment to check what is passed one at a time, and involve a lot of if/else statement.
@click.command()
@click.option('--name')
@click.option('--age')
@click.option('--height)
def check(name,age,height):
if name and age and height:
do_something(name,age,height)
elif name and age:
do_something(name,age)
elif name:
do_something(name)
elif age:
do_something(age)
.
.
Aucun commentaire:
Enregistrer un commentaire