Partial option parsing
Hans-Joachim Widmaier <[email protected]> Thu, 18 Mar 2004 08:11:19 +0100
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <[email protected]> |
[I posted something similar to comp.lang.python and was directed here] [Trying to be more concise now] I have a program which has several subcommands, some generic options and options specific to subcommands. I figured the easiest way to implement this scheme would be to enhance optparse so that OptionParser.parse_args() takes another (optional, of course) argument that allows it to treat unknown options as arguments. This turned out to be rather easy to implement, and so I did. While I was at it, I also added gettext support to the strings (i.e. surrounded them with _()) that will be seen by a end user (messages to exceptions raised by programmer's fault can stay in english). Is there any interest in this? -- Hans-Joachim Widmaier ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click