以下版本0.6.2 docopt字符串无效,虽然我没有发现任何错误:
"""Usage: somecommand.py [-n nos] [-u] [-c] [-s start] Options: -h show help -u some reply -n number to fetch -c ask to do it -s start from? """命令行上的
:
somecommand.py -n 2 -s 5 Usage: privateunreadlybrate.py [-n nos] [-u] [-c] [-s start]
执行不会继续,并且会继续显示输入的任何命令的使用情况。 那么错误在哪里?
答案 0 :(得分:2)
'nos'值也必须在'options:'部分中给出,试试这个:
"""Usage:
somecommand.py [-n nos] [-u] [-c] [-s start]
Options:
-h show help
-u some reply
-n nos number to fetch
-c ask to do it
-s start start from?
"""