diff --git a/src/CLI.cpp b/src/CLI.cpp index 153b14fc..ad69e83d 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -135,6 +135,14 @@ void CLI::add (const std::string& argument) _args.clear (); } +//////////////////////////////////////////////////////////////////////////////// +// Intended to be called after ::add() to perform the final analysis. +void CLI::analyze () +{ + // Process _original_args. + _args.clear (); +} + //////////////////////////////////////////////////////////////////////////////// // Search for 'value' in _entities category, return canonicalized value. bool CLI::canonicalize ( diff --git a/src/CLI.h b/src/CLI.h index 4c1d90b4..9ab0f4f6 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -58,6 +58,7 @@ public: CLI () = default; void entity (const std::string&, const std::string&); void add (const std::string&); + void analyze (); bool canonicalize (std::string&, const std::string&, const std::string&) const; const std::string dump (const std::string& title = "CLI Parser") const; diff --git a/src/timew.cpp b/src/timew.cpp index 2c4f423c..4b1101f6 100644 --- a/src/timew.cpp +++ b/src/timew.cpp @@ -59,6 +59,8 @@ int main (int argc, const char** argv) for (int i = 0; i < argc; i++) cli.add (argv[i]); + cli.analyze (); + // TODO Remove. std::cout << cli.dump () << "\n";