Fixed unregistered-options parsing
This commit is contained in:
parent
70b93a4fb8
commit
e1d14b6951
2 changed files with 8 additions and 6 deletions
|
@ -147,7 +147,7 @@ int main(int argc, char **argv)
|
|||
boost::program_options::positional_options_description p;
|
||||
p.add("config", -1);
|
||||
boost::program_options::store(boost::program_options::command_line_parser(argc, argv).
|
||||
options(desc).positional(p).run(), vm);
|
||||
options(desc).positional(p).allow_unregistered().run(), vm);
|
||||
boost::program_options::notify(vm);
|
||||
|
||||
if (vm.count("version")) {
|
||||
|
|
|
@ -122,6 +122,13 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description
|
|||
("backend.no_vcard_fetch", value<bool>()->default_value(false), "True if VCards for buddies should not be fetched. Only avatars will be forwarded.")
|
||||
;
|
||||
|
||||
// Load configs passed by command line
|
||||
if (m_argc != 0 && m_argv) {
|
||||
basic_command_line_parser<char> parser = command_line_parser(m_argc, m_argv).options(opts).allow_unregistered();
|
||||
parsed_options parsed = parser.run();
|
||||
store(parsed, m_variables);
|
||||
}
|
||||
|
||||
parsed_options parsed = parse_config_file(ifs, opts, true);
|
||||
|
||||
bool found_working = false;
|
||||
|
@ -187,11 +194,6 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description
|
|||
}
|
||||
}
|
||||
|
||||
// Load configs passed by command line
|
||||
if (m_argc != 0 && m_argv) {
|
||||
store(parse_command_line(m_argc, m_argv, opts), m_variables);
|
||||
}
|
||||
|
||||
store(parsed, m_variables);
|
||||
notify(m_variables);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue