CLI: Added ::getWords

This commit is contained in:
Paul Beckingham 2016-04-03 20:33:14 -04:00
parent 02e1690418
commit 63d728af5c
2 changed files with 15 additions and 0 deletions

View file

@ -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 (

View file

@ -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;