('-l', '--list', dest="list_server_or_group_name", help='Get group or server state/configuration')"python my_script.py -l group_name“-用于列出特定的组,"python my_script.py -l all”-用于列出所有组
我有一个脚本,它的用法如下:usage: installer.py dir [-h] [-v]parser.add_argument('dir', default=os.getcwd())
我希望dir是可选的:如果没有指定,它应该只是cwd。不幸的是,当我没有指定dir参数时,我会得到Error: Too few arguments。