Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-21 Thread Robert Kern
On 2009-04-16 19:32, Saptarshi wrote: Saptarshi Preprocess the sys.args before calling optparse. Simply search sys.args for the string "start" and the string "stop", and note whichever comes first. Then use slice operators to peel the extra arguments off of sys.args. Thanks, i implemented you

Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-20 Thread Rhodri James
On Sun, 19 Apr 2009 14:45:45 +0100, David Stanek wrote: On Thu, Apr 16, 2009 at 10:05 AM, sapsi wrote: Hello, Im using optparse and python 2.6 to parse some options, my commandline looks like prog [options] start|stop extra-args-i-will-pas-on The options are --b --c --d The extra options

Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-19 Thread David Stanek
On Thu, Apr 16, 2009 at 10:05 AM, sapsi wrote: > Hello, > Im using optparse and python 2.6 to parse some options, my commandline > looks like > > prog [options] start|stop extra-args-i-will-pas-on > > The options are --b --c --d > > The extra options are varied are are passed onto another program

Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-16 Thread Saptarshi
> > Saptarshi > > Preprocess the sys.args before calling optparse. > Simply search sys.args for the string "start" and the string "stop", and > note whichever comes first.  Then use slice operators to peel the extra > arguments off of sys.args. Thanks, i implemented your logic. I thought there wa

Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-16 Thread Dave Angel
sapsi wrote: Hello, Im using optparse and python 2.6 to parse some options, my commandline looks like prog [options] start|stop extra-args-i-will-pas-on The options are --b --c --d The extra options are varied are are passed onto another program e.g -- quiet --no-command , my program doesnt ca

Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-16 Thread sapsi
Hello, Im using optparse and python 2.6 to parse some options, my commandline looks like prog [options] start|stop extra-args-i-will-pas-on The options are --b --c --d The extra options are varied are are passed onto another program e.g -- quiet --no-command , my program doesnt care what these a