From 5db3b51843c622ee40aa7683b6563923e1429244 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 3 May 2014 15:54:51 +0100 Subject: [PATCH] Add command aliases in command info Fixes #101 --- src/command_manager.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/command_manager.cc b/src/command_manager.cc index a00ac00e..26b2379f 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -432,6 +432,17 @@ CommandInfo CommandManager::command_info(StringView command_line) const res.first = cmd->first; if (not cmd->second.docstring.empty()) res.second += cmd->second.docstring + "\n"; + + String aliases; + for (auto& alias : m_aliases) + { + if (alias.second == cmd->first) + aliases += " " + alias.first; + } + if (not aliases.empty()) + res.second += "Aliases:" + aliases + "\n"; + + auto& switches = cmd->second.param_desc.switches; if (not switches.empty()) {