Changeset 4292:71498c97aa64 in livinglogic.python.xist

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

Output default value in argparse argument help message.

Location:
src/ll
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • src/ll/orasql/scripts/oracreate.py

    r4291 r4292  
    2424    p = argparse.ArgumentParser(description="Print (or execute) the DDL of all objects in an Oracle database schema") 
    2525    p.add_argument("connectstring", help="Oracle connect string") 
    26     p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report?", default=False, action=misc.FlagAction) 
    27     p.add_argument("-c", "--color", dest="color", help="Color output", default="auto", choices=("yes", "no", "auto")) 
    28     p.add_argument("-s", "--seqcopy", dest="seqcopy", help="copy sequence values?", default=False, action=misc.FlagAction) 
     26    p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report? (default %(default)s)", default=False, action=misc.FlagAction) 
     27    p.add_argument("-c", "--color", dest="color", help="Color output (default %(default)s)", default="auto", choices=("yes", "no", "auto")) 
     28    p.add_argument("-s", "--seqcopy", dest="seqcopy", help="copy sequence values? (default %(default)s)", default=False, action=misc.FlagAction) 
    2929    p.add_argument("-x", "--execute", metavar="CONNECTSTRING2", dest="execute", help="Execute in target database") 
    30     p.add_argument("-k", "--keepjunk", dest="keepjunk", help="Output objects with '$' or 'SYS_EXPORT_SCHEMA_' in their name?", default=False, action=misc.FlagAction) 
    31     p.add_argument("-i", "--ignore", dest="ignore", help="Ignore errors?", default=False, action=misc.FlagAction) 
    32     p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output", default="utf-8") 
     30    p.add_argument("-k", "--keepjunk", dest="keepjunk", help="Output objects with '$' or 'SYS_EXPORT_SCHEMA_' in their name? (default %(default)s)", default=False, action=misc.FlagAction) 
     31    p.add_argument("-i", "--ignore", dest="ignore", help="Ignore errors? (default %(default)s)", default=False, action=misc.FlagAction) 
     32    p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output (default %(default)s)", default="utf-8") 
    3333 
    3434    args = p.parse_args(args) 
  • src/ll/orasql/scripts/oradelete.py

    r4291 r4292  
    2424    p = argparse.ArgumentParser(description="Print (or execute) SQL for deleting all records from all tables in an Oracle database schema") 
    2525    p.add_argument("connectstring", help="Oracle connect string") 
    26     p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report?", default=False, action=misc.FlagAction) 
    27     p.add_argument("-c", "--color", dest="color", help="Color output", default="auto", choices=("yes", "no", "auto")) 
    28     p.add_argument("-s", "--sequences", dest="sequences", help="Reset sequences?", default=False, action=misc.FlagAction) 
    29     p.add_argument("-x", "--execute", dest="execute", action="store_true", help="immediately execute the commands instead of printing them?") 
    30     p.add_argument("-i", "--ignore", dest="ignore", help="Ignore errors?", default=False, action=misc.FlagAction) 
    31     p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output", default="utf-8") 
    32     p.add_argument("-t", "--truncate", dest="truncate", help="Truncate tables instead of deleting", default=False, action=misc.FlagAction) 
     26    p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report? (default %(default)s)", default=False, action=misc.FlagAction) 
     27    p.add_argument("-c", "--color", dest="color", help="Color output (default %(default)s)", default="auto", choices=("yes", "no", "auto")) 
     28    p.add_argument("-s", "--sequences", dest="sequences", help="Reset sequences? (default %(default)s)", default=False, action=misc.FlagAction) 
     29    p.add_argument("-x", "--execute", dest="execute", action=misc.FlagAction, help="immediately execute the commands instead of printing them? (default %(default)s)") 
     30    p.add_argument("-i", "--ignore", dest="ignore", help="Ignore errors? (default %(default)s)", default=False, action=misc.FlagAction) 
     31    p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output (default %(default)s)", default="utf-8") 
     32    p.add_argument("-t", "--truncate", dest="truncate", help="Truncate tables (instead of deleting)? (default %(default)s)", default=False, action=misc.FlagAction) 
    3333 
    3434    args = p.parse_args(args) 
  • src/ll/orasql/scripts/oradiff.py

    r4291 r4292  
    114114    p.add_argument("connectionstring1", help="First schema") 
    115115    p.add_argument("connectionstring2", help="Second schema") 
    116     p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report?", default=False, action=misc.FlagAction) 
    117     p.add_argument("-c", "--color", dest="color", help="Color output", default="auto", choices=("yes", "no", "auto")) 
    118     p.add_argument("-m", "--mode", dest="mode", help="Output mode", default="udiff", choices=("brief", "udiff", "full")) 
    119     p.add_argument("-n", "--context", dest="context", help="Number of context lines", type=int, default=2) 
    120     p.add_argument("-k", "--keepjunk", dest="keepjunk", help="Output objects with '$' or 'SYS_EXPORT_SCHEMA_' in their name?", default=False, action=misc.FlagAction) 
    121     p.add_argument("-b", "--blank", dest="blank", help="How to treat whitespace", default="literal", choices=("literal", "trail", "lead", "both", "collapse")) 
    122     p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output", default="utf-8") 
     116    p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report? (default %(default)s)", default=False, action=misc.FlagAction) 
     117    p.add_argument("-c", "--color", dest="color", help="Color output (default %(default)s)", default="auto", choices=("yes", "no", "auto")) 
     118    p.add_argument("-m", "--mode", dest="mode", help="Output mode (default %(default)s)", default="udiff", choices=("brief", "udiff", "full")) 
     119    p.add_argument("-n", "--context", dest="context", help="Number of context lines (default %(default)s)", type=int, default=2) 
     120    p.add_argument("-k", "--keepjunk", dest="keepjunk", help="Output objects with '$' or 'SYS_EXPORT_SCHEMA_' in their name? (default %(default)s)", default=False, action=misc.FlagAction) 
     121    p.add_argument("-b", "--blank", dest="blank", help="How to treat whitespace (default %(default)s)", default="literal", choices=("literal", "trail", "lead", "both", "collapse")) 
     122    p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output (default %(default)s)", default="utf-8") 
    123123 
    124124    args = p.parse_args(args) 
  • src/ll/orasql/scripts/oradrop.py

    r4291 r4292  
    2424    p = argparse.ArgumentParser(description="Print (or execute) drop statements for all objects in an Oracle database schema") 
    2525    p.add_argument("connectstring", help="Oracle connect string") 
    26     p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report?", action=misc.FlagAction, default=False) 
    27     p.add_argument("-c", "--color", dest="color", help="Color output", default="auto", choices=("yes", "no", "auto")) 
    28     p.add_argument("-f", "--fks", dest="fks", help="How should foreign keys from other schemas be treated?", default="disable", choices=("keep", "disable", "drop")) 
    29     p.add_argument("-x", "--execute", dest="execute", help="immediately execute the commands instead of printing them?", action=misc.FlagAction, default=False) 
    30     p.add_argument("-k", "--keepjunk", dest="keepjunk", help="Output objects with '$' in their name?", action=misc.FlagAction, default=False) 
    31     p.add_argument("-i", "--ignore", dest="ignore", help="Ignore errors?", default=False, action=misc.FlagAction) 
    32     p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output", default="utf-8") 
     26    p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report? (default %(default)s)", action=misc.FlagAction, default=False) 
     27    p.add_argument("-c", "--color", dest="color", help="Color output (default %(default)s)", default="auto", choices=("yes", "no", "auto")) 
     28    p.add_argument("-f", "--fks", dest="fks", help="How should foreign keys from other schemas be treated? (default %(default)s)", default="disable", choices=("keep", "disable", "drop")) 
     29    p.add_argument("-x", "--execute", dest="execute", help="immediately execute the commands instead of printing them? (default %(default)s)", action=misc.FlagAction, default=False) 
     30    p.add_argument("-k", "--keepjunk", dest="keepjunk", help="Output objects with '$' in their name? (default %(default)s)", action=misc.FlagAction, default=False) 
     31    p.add_argument("-i", "--ignore", dest="ignore", help="Ignore errors? (default %(default)s)", default=False, action=misc.FlagAction) 
     32    p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output (default %(default)s)", default="utf-8") 
    3333 
    3434    args = p.parse_args(args) 
  • src/ll/orasql/scripts/orafind.py

    r4289 r4292  
    1212import sys, os, argparse 
    1313 
    14 from ll import orasql, astyle 
     14from ll import misc, orasql, astyle 
    1515 
    1616 
  • src/ll/orasql/scripts/oragrant.py

    r4169 r4292  
    1212import sys, os, argparse 
    1313 
    14 from ll import astyle, orasql 
     14from ll import misc, astyle, orasql 
    1515 
    1616 
     
    2424    p = argparse.ArgumentParser(description="Print (and execute) grants statements from an Oracle database schema") 
    2525    p.add_argument("connectstring", help="Oracle connect string") 
    26     p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report?", default=False, action="store_true") 
    27     p.add_argument("-c", "--color", dest="color", help="Color output", default="auto", choices=("yes", "no", "auto")) 
     26    p.add_argument("-v", "--verbose", dest="verbose", help="Give a progress report? (default %(default)s)", default=False, action=misc.FlagAction) 
     27    p.add_argument("-c", "--color", dest="color", help="Color output (default %(default)s)", default="auto", choices=("yes", "no", "auto")) 
    2828    p.add_argument("-x", "--execute", metavar="CONNECTSTRING2", dest="execute", help="Execute in target database") 
    29     p.add_argument("-k", "--keepjunk", dest="keepjunk", help="Output objects with '$' or 'SYS_EXPORT_SCHEMA_' in their name?", default=False, action="store_true") 
    30     p.add_argument("-i", "--ignore", dest="ignore", help="Ignore errors?", default=False, action="store_true") 
     29    p.add_argument("-k", "--keepjunk", dest="keepjunk", help="Output objects with '$' or 'SYS_EXPORT_SCHEMA_' in their name? (default %(default)s)", default=False, action="store_true") 
     30    p.add_argument("-i", "--ignore", dest="ignore", help="Ignore errors? (default %(default)s)", default=False, action=misc.FlagAction) 
    3131    p.add_argument("-m", "--mapgrantee", dest="mapgrantee", help="Map grantees (Python expression: list or dict)", default="True") 
    32     p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output", default="utf-8") 
     32    p.add_argument("-e", "--encoding", dest="encoding", help="Encoding for output (default %(default)s)", default="utf-8") 
    3333 
    3434    args = p.parse_args(args) 
  • src/ll/scripts/db2ul4.py

    r4113 r4292  
    8787    p = argparse.ArgumentParser(description="render UL4 templates containing SQL statements") 
    8888    p.add_argument("templates", metavar="template", help="templates to be used", nargs="+") 
    89     p.add_argument("-i", "--inputencoding", dest="inputencoding", help="Encoding for template sources", default="utf-8", metavar="ENCODING") 
    90     p.add_argument("-o", "--outputencoding", dest="outputencoding", help="Encoding for output", default="utf-8", metavar="ENCODING") 
     89    p.add_argument("-i", "--inputencoding", dest="inputencoding", help="Encoding for template sources (default %(default)s)", default="utf-8", metavar="ENCODING") 
     90    p.add_argument("-o", "--outputencoding", dest="outputencoding", help="Encoding for output (default %(default)s)", default="utf-8", metavar="ENCODING") 
    9191 
    9292    args = p.parse_args(args) 
  • src/ll/xist/scripts/doc2txt.py

    r4174 r4292  
    5353    p.add_argument("target", help="output plain text file") 
    5454    p.add_argument("-t", "--title", dest="title", help="Title for the document") 
    55     p.add_argument("-w", "--width", dest="width", help="Width of the plain text output", type=int, default=72) 
     55    p.add_argument("-w", "--width", dest="width", help="Width of the plain text output (default %(default)s)", type=int, default=72) 
    5656 
    5757    args = p.parse_args() 
  • src/ll/xist/scripts/tld2xsc.py

    r4289 r4292  
    4848def main(args=None): 
    4949    p = argparse.ArgumentParser(description="Convert JSP Tag Library Descriptor XML file (on stdin) to XIST namespace (on stdout)") 
    50     p.add_argument("-s", "--shareattrs", dest="shareattrs", help="Should identical attributes be shared among elements?", choices=("none", "dupes", "all"), default="dupes") 
    51     p.add_argument("-m", "--model", dest="model", help="Add sims information to the namespace", choices=("none", "simple", "fullall", "fullonce"), default="simple") 
    52     p.add_argument("-d", "--defaults", dest="defaults", help="Output default values for attributes?", action=misc.FlagAction, default=False) 
     50    p.add_argument("-s", "--shareattrs", dest="shareattrs", help="Should identical attributes be shared among elements? (default %(default)s)", choices=("none", "dupes", "all"), default="dupes") 
     51    p.add_argument("-m", "--model", dest="model", help="Add sims information to the namespace (default %(default)s)", choices=("none", "simple", "fullall", "fullonce"), default="simple") 
     52    p.add_argument("-d", "--defaults", dest="defaults", help="Output default values for attributes? (default %(default)s)", action=misc.FlagAction, default=False) 
    5353 
    5454    args = p.parse_args(args)