mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CLI
- Implemented ::getDataLocation. - Called ::getDataLocation from Context.
This commit is contained in:
parent
7845786398
commit
c8dfa8f7fd
3 changed files with 26 additions and 1 deletions
23
src/CLI.cpp
23
src/CLI.cpp
|
@ -379,6 +379,29 @@ void CLI::getOverride (std::string& home, File& rc)
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Look for CONFIG data.location and initialize a Path object.
|
||||
void CLI::getDataLocation (Path& data)
|
||||
{
|
||||
std::string location = context.config.get ("data.location");
|
||||
if (location != "")
|
||||
data = location;
|
||||
|
||||
std::vector <A>::const_iterator a;
|
||||
for (a = _args.begin (); a != _args.end (); ++a)
|
||||
{
|
||||
if (a->hasTag ("CONFIG") &&
|
||||
a->attribute ("name") == "data.location")
|
||||
{
|
||||
data = Directory (a->attribute ("value"));
|
||||
context.header (format (STRING_PARSER_ALTERNATE_DATA, (std::string) data));
|
||||
}
|
||||
|
||||
// Keep looping, because if there are multiple overrides, the last one
|
||||
// should dominate.
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Extract all the FILTER-tagged items.
|
||||
const std::string CLI::getFilter ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue