CLI2: Implemented simple argument capture, with no processing.

This commit is contained in:
Paul Beckingham 2015-06-13 14:13:19 -04:00
parent ec5876d56b
commit 23786515f9
3 changed files with 13 additions and 1 deletions

View file

@ -330,6 +330,13 @@ void CLI2::entity (const std::string& category, const std::string& name)
_entities.insert (std::pair <std::string, std::string> (category, name));
}
////////////////////////////////////////////////////////////////////////////////
// Capture a single argument.
void CLI2::add (const std::string& argument)
{
_original_args.push_back (argument);
}
/*
////////////////////////////////////////////////////////////////////////////////
// Capture the original, intact command line arguments.

View file

@ -79,6 +79,8 @@ public:
~CLI2 ();
void alias (const std::string&, const std::string&);
void entity (const std::string&, const std::string&);
void add (const std::string&);
/*
void initialize (int, const char**);
void add (const std::string&);
@ -143,8 +145,8 @@ private:
public:
std::multimap <std::string, std::string> _entities;
std::map <std::string, std::string> _aliases;
/*
std::vector <std::string> _original_args;
/*
std::vector <A> _args;
std::vector <std::pair <int, int>> _id_ranges;

View file

@ -226,6 +226,9 @@ int Context::initialize (int argc, const char** argv)
//
////////////////////////////////////////////////////////////////////////////
for (int i = 0; i < argc; i++)
cli2.add (argv[i]);
cli.initialize (argc, argv);
cli.analyze (true, true);