mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Alias
- Implemented simple word substitution aliases. This is not the ultimate form which will involve the ability to insert arbitrary constructs. Later.
This commit is contained in:
parent
a470e50ee6
commit
1cd09bc87b
7 changed files with 42 additions and 41 deletions
|
@ -145,9 +145,8 @@ int Context::initialize (int argc, const char** argv)
|
|||
createDefaultConfig ();
|
||||
|
||||
// Handle Aliases.
|
||||
loadAliases ();
|
||||
aliases2.load ();
|
||||
aliases2.resolve (parser.tree ());
|
||||
alias.load ();
|
||||
alias.resolve (parser.tree ());
|
||||
|
||||
// Initialize the color rules, if necessary.
|
||||
if (color ())
|
||||
|
@ -669,20 +668,6 @@ void Context::createDefaultConfig ()
|
|||
config.createDefaultData (data_dir);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::loadAliases ()
|
||||
{
|
||||
aliases.clear ();
|
||||
|
||||
std::vector <std::string> vars;
|
||||
config.all (vars);
|
||||
|
||||
std::vector <std::string>::iterator var;
|
||||
for (var = vars.begin (); var != vars.end (); ++var)
|
||||
if (var->substr (0, 6) == "alias.")
|
||||
aliases[var->substr (6)] = config.get (*var);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::decomposeSortField (
|
||||
const std::string& field,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue