[Twisted-Python] Implementing parseargs or getopt using twisted trial

Vishal Sethia sethia.vishal at gmail.com
Wed Jan 17 11:31:50 MST 2007


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20070117/206b151d/attachment.html>


More information about the Twisted-Python mailing list