C++ 如何支持命令行语法-设备:iphone“;在Boost::Program\u选项中?
Boost::Program_选项的默认语法是“-DEVICE iphone”。我如何支持语法“-DEVICE:iphone”或“-DEVICE=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
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”部分的第一项。