mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Enhancement - Aliases
- Moved alias mapping to Context. - Added Context::canonicalize to resolve aliases. - Added Context::loadAliases to reload on config file change. - Removed old alias processing from Cmd. - Doesn't work yet, but the data is loaded.
This commit is contained in:
parent
b6bc72c449
commit
78afa4e110
4 changed files with 44 additions and 28 deletions
24
src/Cmd.cpp
24
src/Cmd.cpp
|
@ -165,30 +165,6 @@ void Cmd::load ()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// Now load the aliases.
|
||||
foreach (i, all)
|
||||
{
|
||||
if (i->substr (0, 6) == "alias.")
|
||||
{
|
||||
std::string name = i->substr (6, std::string::npos);
|
||||
std::string alias = context.config.get (name);
|
||||
|
||||
// Make sure a custom report does not clash with a built-in
|
||||
// command.
|
||||
if (std::find (commands.begin (), commands.end (), report) != commands.end ())
|
||||
throw std::string ("Alias '") + name +
|
||||
"' conflicts with built-in task command.";
|
||||
|
||||
if (std::find (customReports.begin (), customReports.end (), report) != customReports.end ())
|
||||
throw std::string ("Alias '") + name +
|
||||
"' conflicts with custom report.";
|
||||
|
||||
aliases[name] = alias;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue