I like the new add* methods added in 1.9! :-) I'd like to use them, but I'd like to have a method that would accept the Option object.
My app has a few scripts and those scripts use command line params which are flags sometimes, sometimes a position argument which sometimes is a path (so I'd like to normalize it with the normalizer option) and so I thought that I'd make my classes return just array of Options that I'd pass directly to the Parser, otherwise I'd need to use another structure just to pass the options from one class to another to only pass them to the Parser which would create Option objects anyway.
Right now I return array of strings or array of option => value, and then I make a string by imploding the array, only for the Parser to parse it again. I'd like to make it more straightforward.
I can try and create a PR if you think this makes sense to add the method :-)
I like the new
add*methods added in 1.9! :-) I'd like to use them, but I'd like to have a method that would accept theOptionobject.My app has a few scripts and those scripts use command line params which are flags sometimes, sometimes a position argument which sometimes is a path (so I'd like to normalize it with the
normalizeroption) and so I thought that I'd make my classes return just array ofOptions that I'd pass directly to theParser, otherwise I'd need to use another structure just to pass the options from one class to another to only pass them to theParserwhich would createOptionobjects anyway.Right now I return array of strings or array of option => value, and then I make a string by imploding the array, only for the
Parserto parse it again. I'd like to make it more straightforward.I can try and create a PR if you think this makes sense to add the method :-)