we pass "--id <n>" to ceph-osd for specifying the osd id, but seastar
app template also provides an option of "--idle-poll-time-us arg".
boost::program_option::command_line_parser() uses default_style when
parsing options. and default_style includes allow_guessing, which in
turn matches partial option as well, so "--id" matches with "--idle"
when we are trying to figure out which options are consumed by seastar
app template, and which are not. see
https://www.boost.org/doc/libs/1_76_0/doc/html/boost/program_options/command_line_style/style_t.html
so, in this change, stype is specified explicitly, and "allow_guessing"
is removed from the "default_style" before being passed to style(), so
that only the full option name are matched.
Signed-off-by: Kefu Chai <kchai@redhat.com>
// collect all options consumed by seastar::app_template
auto parsed = bpo::command_line_parser(std::distance(argv_begin, argv_end),
argv_begin)
- .options(app.get_options_description()).allow_unregistered().run();
+ .options(app.get_options_description())
+ .style(bpo::command_line_style::default_style &
+ ~bpo::command_line_style::allow_guessing)
+ .allow_unregistered().run();
auto unknown_args = bpo::collect_unrecognized(parsed.options,
bpo::include_positional);
std::vector<const char*> ceph_args, app_args;