@cli.command()
@click.option("-d", "--delay", type=float, default=0.01, help='delay for every line print')
@click.argument("lines", default=10, type=int)
[2021-07-22 15:54:42,258] INFO in cmd_exec: arg_value: "['-0.99']"
[2021-07-22 15:54:42,258] INFO in cmd_exec: arg_value: "['10']"
127.0.0.1 - - [22/Jul/2021 15:54:42] "POST /cli/print-rows HTTP/1.1" 200 -
[2021-07-22 15:54:42,259] INFO in cmd_exec: Executing: ['/venv/bin/python3', '/a.py', 'print-rows', '-0.99', '10']
Option -d is and considered as arg_value
Thus output:
Usage: a.py print-rows [OPTIONS] [LINES]
Try 'a.py print-rows --help' for help.
Error: no such option: -0
When having option with one dash, command is not processed properly: (but one dash is valid option https://click.palletsprojects.com/en/8.0.x/options/#basic-value-options) e.g
Option
-d
is and considered as arg_value Thus output: