diff --git a/src/CLI.cpp b/src/CLI.cpp index 760d7a1b6..ea9a4715c 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -464,6 +464,17 @@ bool CLI::canonicalize ( return false; } +//////////////////////////////////////////////////////////////////////////////// +std::string CLI::getCommand () const +{ + std::vector ::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 { diff --git a/src/CLI.h b/src/CLI.h index e6df50ff9..3c8a53a00 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -74,6 +74,7 @@ public: const std::vector getWords (); const std::vector getModifications (); 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; private: