mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CLI2: Aliases captured.
- CLI2::alias now captures all alias definitions from Context::Config.
This commit is contained in:
parent
22765a70cb
commit
ec5876d56b
3 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue