- Implemented ::getCommand.
This commit is contained in:
Paul Beckingham
2014-10-31 23:11:40 -04:00
parent 6324e3b63a
commit 6056ca4cd7
2 changed files with 12 additions and 0 deletions

View File

@@ -464,6 +464,17 @@ bool CLI::canonicalize (
return false; return false;
} }
////////////////////////////////////////////////////////////////////////////////
std::string CLI::getCommand () const
{
std::vector <A>::const_iterator a;
for (a = _args.begin (); a != _args.end (); ++a)
if (a->hasTag ("CMD"))
return a->attribute ("canonical");
return "";
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
const std::string CLI::dump (const std::string& title /* = "CLI Parser" */) const const std::string CLI::dump (const std::string& title /* = "CLI Parser" */) const
{ {

View File

@@ -74,6 +74,7 @@ public:
const std::vector <std::string> getWords (); const std::vector <std::string> getWords ();
const std::vector <std::string> getModifications (); const std::vector <std::string> getModifications ();
bool canonicalize (std::string&, const std::string&, const std::string&) const; bool canonicalize (std::string&, const std::string&, const std::string&) const;
std::string getCommand () const;
const std::string dump (const std::string& title = "CLI Parser") const; const std::string dump (const std::string& title = "CLI Parser") const;
private: private: