CLI2: Add method to get MISCELLANEOUS tokens
This commit is contained in:
14
src/CLI2.cpp
14
src/CLI2.cpp
@@ -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 ()
|
const std::vector <std::string> CLI2::getWords ()
|
||||||
{
|
{
|
||||||
std::vector <std::string> words;
|
std::vector <std::string> words;
|
||||||
@@ -721,6 +721,18 @@ const std::vector <std::string> CLI2::getWords ()
|
|||||||
return words;
|
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.
|
// Search for 'value' in _entities category, return canonicalized value.
|
||||||
bool CLI2::canonicalize (
|
bool CLI2::canonicalize (
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public:
|
|||||||
void addContext (bool readable, bool writeable);
|
void addContext (bool readable, bool writeable);
|
||||||
void prepareFilter ();
|
void prepareFilter ();
|
||||||
const std::vector <std::string> getWords ();
|
const std::vector <std::string> getWords ();
|
||||||
|
const std::vector <A2> getMiscellaneous ();
|
||||||
bool canonicalize (std::string&, const std::string&, const std::string&);
|
bool canonicalize (std::string&, const std::string&, const std::string&);
|
||||||
std::string getBinary () const;
|
std::string getBinary () const;
|
||||||
std::string getCommand (bool canonical = true) const;
|
std::string getCommand (bool canonical = true) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user