diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2020-01-25 11:51:38 +0200 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2020-01-25 11:51:38 +0200 |
| commit | 7d83a1c5d69d7e93b4013cfa638f8e380a89f3cc (patch) | |
| tree | 9a461916a0a4aa251b3695f3273d116dfce69ec4 /mu | |
| parent | 24e94afe2fe85b581c657cfdbbfe2b90f292d801 (diff) | |
server: improve command documentation output
required args come first, then alphabetic.
Diffstat (limited to 'mu')
| -rw-r--r-- | mu/mu-cmd-server.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mu/mu-cmd-server.cc b/mu/mu-cmd-server.cc index 4e6ab76..5628a82 100644 --- a/mu/mu-cmd-server.cc +++ b/mu/mu-cmd-server.cc @@ -742,11 +742,12 @@ help_handler (Context& context, const Parameters& params) if (!full) continue; - for (auto&& arg: info.args) { + for (auto&& argname: info.sorted_argnames()) { + const auto& arg{info.args.find(argname)}; std::cout << ";; " - << format("%-17s : %-22s ", arg.first.c_str(), - to_string(arg.second).c_str()); - std::cout << " " << arg.second.docstring << "\n"; + << format("%-17s : %-24s ", arg->first.c_str(), + to_string(arg->second).c_str()); + std::cout << " " << arg->second.docstring << "\n"; } std::cout << ";;\n"; } @@ -1090,8 +1091,8 @@ make_command_map (Context& context) cmap.emplace("add", CommandInfo{ - ArgMap{ {"path", ArgInfo{Type::String, true, "message-path" }}, - {"maildir", ArgInfo{Type::String, true, "maildir" }}}, + ArgMap{ {"path", ArgInfo{Type::String, true, "file system path to the message" }}, + {"maildir", ArgInfo{Type::String, true, "the maildir the where the message lives" }}}, "add a message to the store", [&](const auto& params){add_handler(context, params);}}); @@ -1164,7 +1165,7 @@ make_command_map (Context& context) {"cleanup", ArgInfo{Type::Symbol, false, "whether to remove stale messages from the store"}}, {"lazy-check", ArgInfo{Type::Symbol, false, - "Whether to avoid indexing up-to-date directories"}}}, + "whether to avoid indexing up-to-date directories"}}}, "scan maildir for new/updated/removed messages", [&](const auto& params){index_handler(context, params);}}); |
