📜  python argparse 选择 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:09.525000             🧑  作者: Mango

代码示例3
parser.add_argument('--list',
                    default='all',
                    const='all',
                    nargs='?',
                    choices=['servers', 'storage', 'all'],
                    help='list servers, storage, or both (default: %(default)s)')