mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CLI: Added ::getWords
This commit is contained in:
parent
02e1690418
commit
63d728af5c
2 changed files with 15 additions and 0 deletions
14
src/CLI.cpp
14
src/CLI.cpp
|
@ -228,6 +228,20 @@ void CLI::analyze ()
|
|||
canonicalizeNames ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Return all the unknown args.
|
||||
std::vector <std::string> CLI::getWords () const
|
||||
{
|
||||
std::vector <std::string> words;
|
||||
for (const auto& a : _args)
|
||||
if (! a.hasTag ("BINARY") &&
|
||||
! a.hasTag ("CMD") &&
|
||||
! a.hasTag ("HINT"))
|
||||
words.push_back (a.attribute ("raw"));
|
||||
|
||||
return words;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Search for 'value' in _entities category, return canonicalized value.
|
||||
bool CLI::canonicalize (
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
void entity (const std::string&, const std::string&);
|
||||
void add (const std::string&);
|
||||
void analyze ();
|
||||
std::vector <std::string> getWords () const;
|
||||
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
||||
std::string getBinary () const;
|
||||
std::string getCommand () const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue