CLI2: Aliases captured.
- CLI2::alias now captures all alias definitions from Context::Config.
This commit is contained in:
@@ -311,13 +311,11 @@ CLI2::~CLI2 ()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CLI2::alias (const std::string& name, const std::string& value)
|
||||
{
|
||||
_aliases.insert (std::pair <std::string, std::string> (name, value));
|
||||
}
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CLI2::entity (const std::string& category, const std::string& name)
|
||||
|
||||
@@ -77,9 +77,7 @@ public:
|
||||
public:
|
||||
CLI2 ();
|
||||
~CLI2 ();
|
||||
/*
|
||||
void alias (const std::string&, const std::string&);
|
||||
*/
|
||||
void entity (const std::string&, const std::string&);
|
||||
/*
|
||||
void initialize (int, const char**);
|
||||
@@ -144,8 +142,8 @@ private:
|
||||
|
||||
public:
|
||||
std::multimap <std::string, std::string> _entities;
|
||||
/*
|
||||
std::map <std::string, std::string> _aliases;
|
||||
/*
|
||||
std::vector <std::string> _original_args;
|
||||
std::vector <A> _args;
|
||||
|
||||
|
||||
@@ -802,6 +802,10 @@ void Context::updateVerbosity ()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::loadAliases ()
|
||||
{
|
||||
for (auto& i : config)
|
||||
if (i.first.substr (0, 6) == "alias.")
|
||||
cli2.alias (i.first.substr (6), i.second);
|
||||
|
||||
for (auto& i : config)
|
||||
if (i.first.substr (0, 6) == "alias.")
|
||||
cli.alias (i.first.substr (6), i.second);
|
||||
|
||||
Reference in New Issue
Block a user