Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何支持命令行语法-设备:iphone“;在Boost::Program\u选项中?_C++_Boost_Boost Program Options - Fatal编程技术网

C++ 如何支持命令行语法-设备:iphone“;在Boost::Program\u选项中?

C++ 如何支持命令行语法-设备:iphone“;在Boost::Program\u选项中?,c++,boost,boost-program-options,C++,Boost,Boost Program Options,Boost::Program_选项的默认语法是“-DEVICE iphone”。我如何支持语法“-DEVICE:iphone”或“-DEVICE=iphone”?Boost.Program\u选项有很多。您可能会选择以下特定组合: command_line_style::long_allow_adjacent | command_line_style::short_allow_adjacent | command_line_style::allow_long_disguise 命令行解析器的s

Boost::Program_选项的默认语法是“-DEVICE iphone”。我如何支持语法“-DEVICE:iphone”或“-DEVICE=iphone”?

Boost.Program\u选项有很多。您可能会选择以下特定组合:

command_line_style::long_allow_adjacent |
command_line_style::short_allow_adjacent |
command_line_style::allow_long_disguise
命令行解析器的
style
函数应提供以下选项:

    po::store(po::command_line_parser(argc, argv).style(<your styles here>).run(), vm);
po::store(po::命令行解析器(argc,argv).style().run(),vm);

但这不会将“:”作为选项/值分隔符处理。为此,需要一个自定义解析器,这是文档“Howto”部分的第一项。