Code: Improved comments regarding filters/args.

This commit is contained in:
Paul Beckingham 2015-06-07 15:34:33 -04:00
parent f0fbdaf2c9
commit 2f1ca72334
4 changed files with 10 additions and 3 deletions

View file

@ -671,7 +671,8 @@ void CLI::addArg (const std::string& arg)
if (isTerminator (raw)) // --
_terminated = true;
// This is the case where the argument should not be lexed.
// This is the case where the argument should not be lexed, which is when it
// is a single entity, and recognized.
if (_terminated ||
isRCOverride (raw) || // rc:<file>
isConfigOverride (raw) || // rc.<attr>:<value>
@ -2365,7 +2366,8 @@ bool CLI::disqualifyFirstLastBinary (
}
////////////////////////////////////////////////////////////////////////////////
// Disqualify terms when there operators hidden by syntactic sugar.
// Disqualify terms when there are operators hidden by syntactic sugar.
// TODO This always returns false. Why bother?
bool CLI::disqualifySugarFree (
const std::vector <std::pair <std::string, Lexer::Type>>& lexemes) const
{

View file

@ -334,6 +334,9 @@ int CmdCalendar::execute (std::string& output)
if (context.commands.find (report) == context.commands.end ())
throw std::string (STRING_ERROR_DETAILS);
// TODO Fix this: cal --> task
// calendar --> taskendar
// If the executable was "cal" or equivalent, replace it with "task".
std::string executable = context.cli._args[0].attribute ("raw");
auto cal = executable.find ("cal");

View file

@ -143,6 +143,7 @@ int CmdContext::defineContext (std::vector <std::string>& words, std::stringstre
try
{
// This result is not used, and is just to check validity.
context.cli.addRawFilter ("( " + value + " )");
filter.subset (pending, filtered);
}

View file

@ -81,7 +81,8 @@ int CmdCustom::execute (std::string& output)
split (sortOrder, reportSort, ',');
validateSortColumns (sortOrder);
// Prepend the argument list with those from the report filter.
// Add the report filter to any existing filter from the command line or
// context.
context.cli.addRawFilter (reportFilter);
// Apply filter.