summaryrefslogtreecommitdiff
path: root/src/command_manager.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-12-24 02:06:22 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-12-24 02:06:22 +0000
commitfd17ea00ddbb50118bcca0b3d5c431888e30105b (patch)
tree460956366bd0a598d67e8afc1d08255120ce0dca /src/command_manager.hh
parent01e1169e2c9ca9d7e3956e593a47e1e2d7e7d30c (diff)
CommandManager: use aliases for commands rather than duplicating data
Completion now only proposes full command names
Diffstat (limited to 'src/command_manager.hh')
-rw-r--r--src/command_manager.hh7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/command_manager.hh b/src/command_manager.hh
index 92bbd7f2..72a4a7f8 100644
--- a/src/command_manager.hh
+++ b/src/command_manager.hh
@@ -79,13 +79,18 @@ public:
private:
void execute_single_command(CommandParameters params,
Context& context) const;
+
struct CommandDescriptor
{
Command command;
CommandFlags flags;
CommandCompleter completer;
};
- std::unordered_map<String, CommandDescriptor> m_commands;
+ using CommandMap = std::unordered_map<String, CommandDescriptor>;
+ CommandMap m_commands;
+ std::unordered_map<String, String> m_aliases;
+
+ CommandMap::const_iterator find_command(const String& name) const;
};
}