CLI: Added ::analyze and called it

This commit is contained in:
Paul Beckingham 2016-04-02 15:49:39 -04:00
parent 021297edd5
commit 0ddc2d4d7f
3 changed files with 11 additions and 0 deletions

View file

@ -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 (

View file

@ -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;

View file

@ -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";