mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI2: Implemented simple argument capture, with no processing.
This commit is contained in:
parent
ec5876d56b
commit
23786515f9
3 changed files with 13 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue