CLI: Added ::add

This commit is contained in:
Paul Beckingham 2016-04-02 14:09:10 -04:00
parent e695b0773b
commit 01bbc3d915
2 changed files with 15 additions and 0 deletions

View file

@ -92,6 +92,18 @@ void CLI::entity (const std::string& category, const std::string& name)
_entities.insert (std::pair <std::string, std::string> (category, name));
}
////////////////////////////////////////////////////////////////////////////////
// Capture a single argument.
void CLI::add (const std::string& argument)
{
A2 arg (Lexer::trim (argument), Lexer::Type::word);
arg.tag ("ORIGINAL");
_original_args.push_back (arg);
// Adding a new argument invalidates prior analysis.
_args.clear ();
}
////////////////////////////////////////////////////////////////////////////////
// Search for 'value' in _entities category, return canonicalized value.
bool CLI::canonicalize (