是的,您可以将
help选项设置
add_argument为
argparse.SUPPRESS。这是argparse文档中的示例:
>>> parser = argparse.ArgumentParser(prog='frobble')>>> parser.add_argument('--foo', help=argparse.SUPPRESS)>>> parser.print_help()usage: frobble [-h]optional arguments: -h, --help show this help message and exit


