CLI: Cleaned up and documented context filter code.
This commit is contained in:
@@ -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 ()
|
||||
{
|
||||
// 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
|
||||
if (_args.size ())
|
||||
{
|
||||
for (auto& a : _args)
|
||||
{
|
||||
// TODO This looks wrong.
|
||||
@@ -383,7 +383,6 @@ void CLI::addContextFilter ()
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply context
|
||||
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 ()
|
||||
{
|
||||
for (auto& a : _args)
|
||||
|
||||
Reference in New Issue
Block a user