mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CLI: Added ::analyze and called it
This commit is contained in:
parent
021297edd5
commit
0ddc2d4d7f
3 changed files with 11 additions and 0 deletions
|
@ -135,6 +135,14 @@ void CLI::add (const std::string& argument)
|
||||||
_args.clear ();
|
_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.
|
// Search for 'value' in _entities category, return canonicalized value.
|
||||||
bool CLI::canonicalize (
|
bool CLI::canonicalize (
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
CLI () = default;
|
CLI () = default;
|
||||||
void entity (const std::string&, const std::string&);
|
void entity (const std::string&, const std::string&);
|
||||||
void add (const std::string&);
|
void add (const std::string&);
|
||||||
|
void analyze ();
|
||||||
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
||||||
const std::string dump (const std::string& title = "CLI Parser") const;
|
const std::string dump (const std::string& title = "CLI Parser") const;
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,8 @@ int main (int argc, const char** argv)
|
||||||
for (int i = 0; i < argc; i++)
|
for (int i = 0; i < argc; i++)
|
||||||
cli.add (argv[i]);
|
cli.add (argv[i]);
|
||||||
|
|
||||||
|
cli.analyze ();
|
||||||
|
|
||||||
// TODO Remove.
|
// TODO Remove.
|
||||||
std::cout << cli.dump () << "\n";
|
std::cout << cli.dump () << "\n";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue