Commit b9e7115d authored by Dominik Charousset's avatar Dominik Charousset

Fix -h, --long-help, etc.

parent 792f39c2
...@@ -254,16 +254,16 @@ error actor_system_config::parse(string_list args, std::istream& ini) { ...@@ -254,16 +254,16 @@ error actor_system_config::parse(string_list args, std::istream& ini) {
remainder.insert(remainder.end(), make_move_iterator(first), remainder.insert(remainder.end(), make_move_iterator(first),
make_move_iterator(args.end())); make_move_iterator(args.end()));
} else { } else {
cli_helptext_printed = get_or(content, "global.help", false) cli_helptext_printed = get_or(content, "help", false)
|| get_or(content, "global.long-help", false); || get_or(content, "long-help", false);
} }
// Generate help text if needed. // Generate help text if needed.
if (cli_helptext_printed) { if (cli_helptext_printed) {
bool long_help = get_or(content, "global.long-help", false); bool long_help = get_or(content, "long-help", false);
std::cout << custom_options_.help_text(!long_help) << std::endl; std::cout << custom_options_.help_text(!long_help) << std::endl;
} }
// Generate INI dump if needed. // Generate INI dump if needed.
if (!cli_helptext_printed && get_or(content, "global.dump-config", false)) { if (!cli_helptext_printed && get_or(content, "dump-config", false)) {
for (auto& category : content) { for (auto& category : content) {
if (auto dict = get_if<config_value::dictionary>(&category.second)) { if (auto dict = get_if<config_value::dictionary>(&category.second)) {
std::cout << '[' << category.first << "]\n"; std::cout << '[' << category.first << "]\n";
......
...@@ -62,7 +62,6 @@ CAF_TEST(lookup) { ...@@ -62,7 +62,6 @@ CAF_TEST(lookup) {
CAF_CHECK_EQUAL(opts.size(), 3u); CAF_CHECK_EQUAL(opts.size(), 3u);
CAF_MESSAGE("lookup by long name"); CAF_MESSAGE("lookup by long name");
CAF_CHECK_NOT_EQUAL(opts.cli_long_name_lookup("opt1"), nullptr); CAF_CHECK_NOT_EQUAL(opts.cli_long_name_lookup("opt1"), nullptr);
CAF_CHECK_NOT_EQUAL(opts.cli_long_name_lookup("global.opt1"), nullptr);
CAF_CHECK_NOT_EQUAL(opts.cli_long_name_lookup("test.opt2"), nullptr); CAF_CHECK_NOT_EQUAL(opts.cli_long_name_lookup("test.opt2"), nullptr);
CAF_CHECK_NOT_EQUAL(opts.cli_long_name_lookup("test.flag"), nullptr); CAF_CHECK_NOT_EQUAL(opts.cli_long_name_lookup("test.flag"), nullptr);
CAF_MESSAGE("lookup by short name"); CAF_MESSAGE("lookup by short name");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment