我正在尝试使用python参数解析进行一些特定的打印,但有些事我无法做到。
parser.add_argument('-m' , help="test a specific module")
以上是我的代码。
optional arguments:
-h, --help show this help message and exit
-m M test a specific module
以上是结果。
但我想拥有的是:
optional arguments:
-h, --help show this help message and exit
-m MODULE test a specific module
我知道这不是很重要,但我真的希望得到这个输出。
谢谢!
答案 0 :(得分:2)
这可以通过添加main
metavar