Changeset 3031:bbcf87fbed09 in livinglogic.python.xist for src/ll/xist/scripts/xml2xsc.py

Show
Ignore:
Timestamp:
11/13/07 22:28:12 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add the ability to pass arguments to all main functions in the scripts.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/scripts/xml2xsc.py

    r2987 r3031  
    120120 
    121121 
    122 def main(): 
     122def main(args=None): 
    123123    p = optparse.OptionParser(usage="usage: %prog [options] <input.xml >output.py") 
    124124    p.add_option("-p", "--parser", dest="parser", help="parser module to use for XML parsing (etree or lxml)", choices=("etree", "lxml"), default="etree") 
     
    126126    p.add_option("-s", "--sims", dest="sims", help="Create sims info? (%s)" % ", ".join(choices), metavar="MODE", default="simple") 
    127127 
    128     (options, args) = p.parse_args() 
     128    (options, args) = p.parse_args(args) 
    129129    if len(args) != 0: 
    130130        p.error("incorrect number of arguments")