3#include <unordered_map>
12 const std::vector<std::pair<std::vector<std::string>,
CommandFactory>>& commands
14 std::unordered_map<std::string, CommandFactory> map;
15 for (
auto& cmd : commands) {
16 for (
auto& alias : cmd.first) {
17 map[alias] = cmd.second;
24 const std::string& name,
25 const std::vector<std::pair<std::vector<std::string>,
CommandFactory>>& commands
28 auto it = internal_commands.find(name);
29 if (it != internal_commands.end()) {
std::unique_ptr< ICommand > get_command(const std::string &name, const std::vector< std::pair< std::vector< std::string >, CommandFactory > > &commands)
std::function< std::unique_ptr< ICommand >()> CommandFactory
std::unordered_map< std::string, CommandFactory > build_command_map(const std::vector< std::pair< std::vector< std::string >, CommandFactory > > &commands)