mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
CLI: Cleaned up and documented context filter code.
This commit is contained in:
parent
490742284b
commit
7f763aacb9
1 changed files with 13 additions and 12 deletions
|
@ -357,6 +357,8 @@ void CLI::add (const std::string& arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// There are situations where a context filter is applied. This method
|
||||||
|
// determines whether one applies, and if so, applies it.
|
||||||
void CLI::addContextFilter ()
|
void CLI::addContextFilter ()
|
||||||
{
|
{
|
||||||
// Detect if any context is set, and bail out if not
|
// Detect if any context is set, and bail out if not
|
||||||
|
@ -368,8 +370,6 @@ void CLI::addContextFilter ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detect if UUID or ID is set, and bail out
|
// Detect if UUID or ID is set, and bail out
|
||||||
if (_args.size ())
|
|
||||||
{
|
|
||||||
for (auto& a : _args)
|
for (auto& a : _args)
|
||||||
{
|
{
|
||||||
// TODO This looks wrong.
|
// TODO This looks wrong.
|
||||||
|
@ -383,7 +383,6 @@ void CLI::addContextFilter ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Apply context
|
// Apply context
|
||||||
context.debug ("Applying context: " + contextName);
|
context.debug ("Applying context: " + contextName);
|
||||||
|
@ -495,6 +494,8 @@ void CLI::analyze (bool parse /* = true */, bool strict /* = false */)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Scan arguments, looking for any tagged CONFIG, in which case extract the name
|
||||||
|
// and value, applying it to context.config.
|
||||||
void CLI::applyOverrides ()
|
void CLI::applyOverrides ()
|
||||||
{
|
{
|
||||||
for (auto& a : _args)
|
for (auto& a : _args)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue