CLI: Added ::getCommand

This commit is contained in:
Paul Beckingham 2016-04-03 13:25:50 -04:00
parent 518389ec58
commit f44194d54d
2 changed files with 11 additions and 0 deletions

View file

@ -260,6 +260,16 @@ bool CLI::canonicalize (
return false; return false;
} }
////////////////////////////////////////////////////////////////////////////////
std::string CLI::getCommand () const
{
for (const auto& a : _args)
if (a.hasTag ("CMD"))
return a.attribute ("canonical");
return "";
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
const std::string CLI::dump (const std::string& title) const const std::string CLI::dump (const std::string& title) const
{ {

View file

@ -60,6 +60,7 @@ public:
void add (const std::string&); void add (const std::string&);
void analyze (); void analyze ();
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: