boost program_options是否支持关闭开关(例如——no-myswitch或-s=no)
Does boost program_options support off-switches (e.g. --no-myswitch or -s=no)
当我为程序定义布尔开关时,例如
("foo,f", "frobnicate")
我想说
myprogram --foo
myprogram --no-foo
myprogram --foo=no
或者至少,第一个和第二个或第三个中的一个。program_options支持这个吗?还是我必须"手动"定义这些开关?
您必须自己定义它们。
库告诉你在命令行上给出了哪些选项,然后由你来将这些选项映射到特性/标志/任何东西。因此,它不会告诉你功能/标志/任何东西是"开"还是"关";
相关文章:
- "error: no matching function for call to"构造函数错误
- 调用专用模板时出错"no matching function for call to [...]"
- 子目录是否继承属性,例如add_definitions,include_directories和父Cmakelist.t
- 标准是否使用多余的大括号(例如 T{{{10}}})定义列表初始化?
- 将数字转换为字母(例如:123 转换为一二三)
- Visual studio代码重构似乎不起作用(例如,重命名符号-f2)
- 如何计算数据类型的范围,例如int
- c++20[[no.unique_address]]中的新功能是什么
- 以线程安全的方式调用"QQuickPaintedItem::updateImage(const QImage&image)"(no QThread)
- "no matching function for call to 'Vector::Vector'"错误
- 这是否符合C++标准:双响双响,例如!!(-0.0).
- Android NDK clang 编译器错误在 Windows 上显示'No such file or directory'
- 如何将CMSampleBufferRef/CIImage/UIImage转换为像素,例如uint8_t[]
- 使用 make 编译 MPI,几个命名空间错误,例如"错误:未知类型名称'使用'?
- 如何使用文件中的文本,例如变量
- 输入值后,如何在一个括号下显示值,例如"{6,7,8,9}
- 给定一个类型,如何派生一个泛型更广泛的类型(例如,用于溢出安全求和)?
- 处理"no operator found"
- 初学者问题:如何使用这些晦涩难懂的命令,例如C++中的'RenderWindow'
- boost program_options是否支持关闭开关(例如——no-myswitch或-s=no)