diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-06-04 08:37:51 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-06-04 08:37:51 +0100 |
| commit | 261e0fabccad0e147592d41b38390bdef24dd69d (patch) | |
| tree | fe5b548b044b20714934d4cff9434cfe2aa13b0f /src/command_manager.cc | |
| parent | 610113860629f2297c1a09f2038fe47ce6a18b3a (diff) | |
Improve readability of command docstrings by changing formatting
Fixes #1378
Diffstat (limited to 'src/command_manager.cc')
| -rw-r--r-- | src/command_manager.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/command_manager.cc b/src/command_manager.cc index e2294b37..fa7a5044 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -538,26 +538,19 @@ Optional<CommandInfo> CommandManager::command_info(const Context& context, Strin } String helpstr = cmd->value.helper(context, params); if (not helpstr.empty()) - { - if (helpstr.back() != '\n') - helpstr += '\n'; - res.info += helpstr; - } + res.info += format("{}\n", helpstr); } String aliases; for (auto& alias : context.aliases().aliases_for(cmd->key)) aliases += " " + alias; if (not aliases.empty()) - res.info += "Aliases:" + aliases + "\n"; + res.info += format("Aliases:{}\n", aliases); auto& switches = cmd->value.param_desc.switches; if (not switches.empty()) - { - res.info += "Switches:\n"; - res.info += generate_switches_doc(switches); - } + res.info += format("Switches:\n{}", indent(generate_switches_doc(switches))); return res; } |
