Closed tannerli closed 8 years ago
Thx, see comments :)
Oh dear... seems my python is more rusty than anticipated... I was under the impression you were doing a bash-style args parsing by deleting tokens[0] and then shifting... Should've read that more carefully.
On the other hand I didn't want to just open an issue and let you do all the work... You may or may not accept these changes on whichever level you want :)
I was under the impression you were doing a bash-style args parsing by deleting tokens[0] and then shifting... Should've read that more carefully.
Well, it's a hack because I do this "natural parsing", where I simply create a list of token pairs. The log level was added later on, and because I only had that single "non-standard" argument I used the index and del method, which isn't too nice :)
Would you like to come up with a nicer parse method? We could check if one of the tokens matches -[a-zA-Z]
, parse it and the following token, and then remove them from the args.
Sure, why not. So I'd implement according to your comments, and refactor the parsing to be able to parse both log-level, proxy host (and potentially more) arguments.
I'll close this pull request and open another once I'm done. Review it carefully though, I'm currently in Java-mode ;-)
+added option -p --proxy [host:ip] +added help text info +added help text example