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 your logic. I thought there was a Optparse
feature to handle this.

There is:

  parser.allow_interspersed_args = False

This means that as soon as the parser hits start|stop, it assumes that everything following it is an argument and not an option that it needs to try to parse.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to