[Twisted-Python] Implementing parseargs or getopt using twisted trial
Hi, How do I implement user defined command line options in addition to the default switches that are available while running twisted trial. For ex. if I have my own py file which I execute using the python compiler has the following line of code to support several command line options, how do I achieve this using twisted trial For eg, for o,a in opts: if o == "-d": debug = 1 if o in ["-h","--help"]: Usage() sys.exit(2) if o in ["-c","--configfile"]: if debug: config_file = a if o in ["-f","--factory"]: flash="FALSE" if o in ["-o","--output"]: log_file = file(a,"w") Any pointers would be greatly appreciated. Thanks, -- V
On Wed, 17 Jan 2007 10:31:50 -0800, Vishal Sethia <sethia.vishal@gmail.com> wrote:
Hi,
How do I implement user defined command line options in addition to the default switches that are available while running twisted trial. For ex. if I have my own py file which I execute using the python compiler has the following line of code to support several command line options, how do I achieve this using twisted trial
This isn't supported. So, the way you achieve it is by modifying the trial script and submitting a patch to Twisted. :) Additionally, Options in Twisted programs are typically parsed using twisted.python.usage, not getopt or optparse or argparse or getarg or argopt or optarg. Jean-Paul
participants (2)
-
Jean-Paul Calderone
-
Vishal Sethia