mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CLI: Added ::add
This commit is contained in:
parent
e695b0773b
commit
01bbc3d915
2 changed files with 15 additions and 0 deletions
12
src/CLI.cpp
12
src/CLI.cpp
|
@ -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 (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue