dbrgn / fahrplan

A SBB/CFF/FFS commandline based timetable client. Project started at make.opendata.ch.
GNU General Public License v3.0
132 stars 20 forks source link

Added support for proxy servers #20

Closed tannerli closed 8 years ago

tannerli commented 8 years ago

+added option -p --proxy [host:ip] +added help text info +added help text example

dbrgn commented 8 years ago

Thx, see comments :)

tannerli commented 8 years ago

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 :)

dbrgn commented 8 years ago

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.

tannerli commented 8 years ago

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 ;-)