Changeset 4288:ad9c308b50f7 in livinglogic.python.xist for src/ll/xist/scripts/dtd2xsc.py

Show
Ignore:
Timestamp:
01/20/11 11:03:25 (9 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Use misc.FlagAction? for flag options in dtd2xsc.py. Add metavar.

Files:
1 modified

Legend:

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

    r4284 r4288  
    3232    from xmlproc import dtdparser 
    3333 
    34 from ll import url 
     34from ll import misc, url 
    3535from ll.xist import xsc, parse, xnd 
    3636 
     
    180180    p = argparse.ArgumentParser(description="Convert DTDs to XIST namespace (on stdout)") 
    181181    p.add_argument("urls", metavar="urls", type=url.URL, help="ULRs of DTDs to be parsed", nargs="+") 
    182     p.add_argument("-x", "--xmlns", dest="xmlns", help="the namespace name for this module") 
    183     p.add_argument("-s", "--shareattrs", dest="shareattrs", help="Should identical attributes be shared among elements?", choices=("none", "dupes", "all"), default="dupes") 
    184     p.add_argument("-m", "--model", dest="model", default="once", help="Add sims information to the namespace", choices=("no", "all", "once")) 
    185     p.add_argument("-d", "--defaults", action="store_true", dest="defaults", help="Output default values for attributes?") 
    186     p.add_argument(      "--duplicates", dest="duplicates", help="How to handle duplicate elements from multiple DTDs", choices=("reject", "allow", "merge")) 
     182    p.add_argument("-x", "--xmlns", dest="xmlns", metavar="NAME", help="the namespace name for this module") 
     183    p.add_argument("-s", "--shareattrs", dest="shareattrs", help="Should identical attributes be shared among elements? (default: %(default)s)", choices=("none", "dupes", "all"), default="dupes") 
     184    p.add_argument("-m", "--model", dest="model", default="once", help="Add sims information to the namespace (default: %(default)s)", choices=("no", "all", "once")) 
     185    p.add_argument("-d", "--defaults", dest="defaults", help="Output default values for attributes? (default: %(default)s)", action=misc.FlagAction, default=False) 
     186    p.add_argument(      "--duplicates", dest="duplicates", help="How to handle duplicate elements from multiple DTDs (default: %(default)s)", choices=("reject", "allow", "merge"), default="reject") 
    187187 
    188188    args = p.parse_args(args)