argparse icon indicating copy to clipboard operation
argparse copied to clipboard

可选参数的option应该怎么写?

Open AngusLkc opened this issue 3 years ago • 1 comments

比如:OPT_BOOLEAN('t', "test", &test, "test only", NULL, 0, 0), 我想命令行参数中-t带与不带参数均可正常解析能实现吗

AngusLkc avatar Jun 09 '21 16:06 AngusLkc

boolean 不需要参数,只是 flag 存在与否来表示 true/false 但目前实现好像带参数也行..

cofyc avatar Jun 10 '21 03:06 cofyc