mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI
- ::initialize captures all args.
This commit is contained in:
parent
df54b8ee43
commit
64d4d659ef
2 changed files with 14 additions and 0 deletions
10
src/CLI.cpp
10
src/CLI.cpp
|
@ -54,3 +54,13 @@ void CLI::entity (const std::string& name, const std::string& value)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Capture the original, intact command line arguments. These will not be
|
||||||
|
// modified.
|
||||||
|
void CLI::initialize (int argc, const char** argv)
|
||||||
|
{
|
||||||
|
_program = argv[0];
|
||||||
|
for (int i = 1; i < argc; ++i)
|
||||||
|
_args.push_back (argv[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#define INCLUDED_CLI
|
#define INCLUDED_CLI
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
class CLI
|
class CLI
|
||||||
|
@ -36,12 +37,15 @@ public:
|
||||||
~CLI ();
|
~CLI ();
|
||||||
void alias (const std::string&, const std::string&);
|
void alias (const std::string&, const std::string&);
|
||||||
void entity (const std::string&, const std::string&);
|
void entity (const std::string&, const std::string&);
|
||||||
|
void initialize (int, const char**);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::multimap <std::string, std::string> _entities;
|
std::multimap <std::string, std::string> _entities;
|
||||||
std::map <std::string, std::string> _aliases;
|
std::map <std::string, std::string> _aliases;
|
||||||
|
std::string _program;
|
||||||
|
std::vector <std::string> _args;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue