diff --git a/src/CLI.cpp b/src/CLI.cpp index 88608b3a..b58928c1 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -228,6 +228,20 @@ void CLI::analyze () canonicalizeNames (); } +//////////////////////////////////////////////////////////////////////////////// +// Return all the unknown args. +std::vector CLI::getWords () const +{ + std::vector words; + for (const auto& a : _args) + if (! a.hasTag ("BINARY") && + ! a.hasTag ("CMD") && + ! a.hasTag ("HINT")) + words.push_back (a.attribute ("raw")); + + return words; +} + //////////////////////////////////////////////////////////////////////////////// // Search for 'value' in _entities category, return canonicalized value. bool CLI::canonicalize ( diff --git a/src/CLI.h b/src/CLI.h index 4c0610f4..2e5c674c 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -59,6 +59,7 @@ public: void entity (const std::string&, const std::string&); void add (const std::string&); void analyze (); + std::vector getWords () const; bool canonicalize (std::string&, const std::string&, const std::string&) const; std::string getBinary () const; std::string getCommand () const;