That's very context specific, how to handle the arguments, is it not?
Printable View
That's very context specific, how to handle the arguments, is it not?
I thought I'd divide the arguments into key/value pairs, where the seperator is a '=', arguments without assigned values (ie. no '=') would become a key where the value is an empty string. Other then that the arguments would be seperated by whitespace.
For example:
Code:Argument : (key, value)
--------------------------------------------
first=one : ("first", "one")
second = two : ("second", "two")
-p : ("-p", "")
Ah, that makes sense. It's not that bad an idea, really.
You could just make a utility function that parses arguments and returns a std::map, though.