如何将ArgumentParser参数的显示名称(目标)保留在帮助消息之外?

问题描述 投票:0回答:1

基本上与这里的问题相同:ArgumentParser: remove capitalized names of arguments from the help message但是它从未解决过...

argument

help message

python python-3.x formatting parameter-passing command-line-arguments
1个回答
0
投票

您可能遇到的情况是将“目标”设置为空:

parser.add_argument('-f', '--foo',dest="\b", help="accepts foo")

这里我使用\ b删除帮助描述中生成的空间。

输出

-f, --foo accepts foo

© www.soinside.com 2019 - 2024. All rights reserved.