Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ArgParse {
- public:
- ArgParse(const int& argc, char** &argv)
- {
- args = [x for x in argv];
- init();
- }
- bool is_filename();
- string filename();
- bool is_keys();
- vector<string> keys(); // these are ordered
- string logfile();
- vool is_logfile();
- public:
- void init()
- {
- keys = [k for k in args if k is a key];
- filename = args[1];
- logfile_ = [if '--log' in args and args[(index next to --log)]]
- }
- vector<string> args;
- const string filename_;
- const string logfile_;
- const vector<string> keys_;
- }
- ArgParse ArgParse(argc, argv)
- vector<string> keys = ArgParse.keys()
Add Comment
Please, Sign In to add comment