CLI2: Add method to get MISCELLANEOUS tokens

This commit is contained in:
Tomas Babej 2021-09-18 13:42:25 -04:00
parent 5bbb1697af
commit 4e00106c71
2 changed files with 14 additions and 1 deletions

View file

@ -701,7 +701,7 @@ void CLI2::prepareFilter ()
}
////////////////////////////////////////////////////////////////////////////////
// Return all the MISCELLANEOUS args.
// Return all the MISCELLANEOUS args as strings.
const std::vector <std::string> CLI2::getWords ()
{
std::vector <std::string> words;
@ -721,6 +721,18 @@ const std::vector <std::string> CLI2::getWords ()
return words;
}
////////////////////////////////////////////////////////////////////////////////
// Return all the MISCELLANEOUS args.
const std::vector <A2> CLI2::getMiscellaneous ()
{
std::vector <A2> misc;
for (const auto& a : _args)
if (a.hasTag ("MISCELLANEOUS"))
misc.push_back (a);
return misc;
}
////////////////////////////////////////////////////////////////////////////////
// Search for 'value' in _entities category, return canonicalized value.
bool CLI2::canonicalize (

View file

@ -78,6 +78,7 @@ public:
void addContext (bool readable, bool writeable);
void prepareFilter ();
const std::vector <std::string> getWords ();
const std::vector <A2> getMiscellaneous ();
bool canonicalize (std::string&, const std::string&, const std::string&);
std::string getBinary () const;
std::string getCommand (bool canonical = true) const;