Flask Commands and Arguments

How do you allow the CLIS Flask command to accept an argument?

It seems that the checkbox configures the Click Group object, so this does not work:

@app.cli.command()
@app.cli.argument('email')
def user_info(email):
    ...
+4
source share
1 answer

@app.cli.commandshould only report clickit user_info. If you need arguments and other click functions, use also click.

@app.cli.command()
@click.option('--email')
def user_info(email):
    ...
+8
source

Source: https://habr.com/ru/post/1679970/


All Articles