mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 02:17:21 +02:00
CLI
- Updated ::getOverride to scan all args, display the debug feedback, and derive the home dir. - Removed Parser::getOverrides calls from Context. - Cleaned up dead code in Context::initialize.
This commit is contained in:
parent
d49222e8c7
commit
9799fcefed
3 changed files with 20 additions and 22 deletions
20
src/CLI.cpp
20
src/CLI.cpp
|
@ -355,14 +355,28 @@ void CLI::analyze (bool parse /* = true */)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string CLI::getOverride ()
|
||||
void CLI::getOverride (std::string& home, File& rc)
|
||||
{
|
||||
std::vector <A>::const_iterator a;
|
||||
for (a = _args.begin (); a != _args.end (); ++a)
|
||||
{
|
||||
if (a->hasTag ("RC"))
|
||||
return a->attribute ("file");
|
||||
{
|
||||
rc = File (a->attribute ("file"));
|
||||
home = rc;
|
||||
|
||||
return "";
|
||||
std::string::size_type last_slash = rc._data.rfind ("/");
|
||||
if (last_slash != std::string::npos)
|
||||
home = rc._data.substr (0, last_slash);
|
||||
else
|
||||
home = ".";
|
||||
|
||||
context.header (format (STRING_PARSER_ALTERNATE_RC, rc._data));
|
||||
|
||||
// Keep looping, because if there are multiple rc:file arguments, the last
|
||||
// one should dominate.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue