Changeset 79:4ebbe78a7734 in livinglogic.python.tipimaid

Show
Ignore:
Timestamp:
02/03/09 10:59:41 (10 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Use metavars for the options. Enhance help strings.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • liaalh.py

    r78 r79  
    198198    import optparse 
    199199    p = optparse.OptionParser(usage="usage: %prog filename-pattern [options]\nIf you use virtual hosts please note that the virtual host column (%v) has to be the first column in every logfile!") 
    200     p.add_option("-b", "--buffertime", dest="buffertime", type="int", action="store", help="Time in seconds for which log entries are buffered, default=0. Set to 0 to disable buffering", default=0) 
    201     p.add_option("-z", "--continuous-gzip", dest="gzip", type="int", action="store", help="If set, logs are (continuously!) gzipped with this compression level (lowest: 1, highest: 9)", default=None) 
     200    p.add_option("-b", "--buffertime", dest="buffertime", metavar="SECONDS", type="int", action="store", help="Time in seconds for which log entries are buffered, default=0. Set to 0 to disable buffering.", default=0) 
     201    p.add_option("-z", "--continuous-gzip", dest="gzip", metavar="COMPRESSIONLEVEL", type="int", action="store", help="If set, logs are (continuously!) gzipped with this compression level (lowest: 1, highest: 9).", default=None) 
    202202    p.add_option("-u", "--utcrotate", dest="utcrotate", action="store_true", help="If set, UTC time determines the time for filenames and rotation. Otherwise local time is used.", default=False) 
    203     p.add_option("-s", "--symlink", dest="symlinkpattern", action="store", help="""Create a symlink pointing to the most recent log file (of each virtual host if you use %v). Needs a filename pattern for the symlink but only "%v" is allowed here as symlinks which include time/date data are useless, e.g. %v/access.log or symlinks/access-%v.log""", default=None) 
    204     p.add_option("-x", "--execute", dest="execute", type="string", action="store", help="After writing to a logfile is finished and a new one is created (e.g. after rotating the logs), the given executable is started with the logfile as its first (and only) parameter. You could use gzip, bzip2, a self-written bash-script or even rm here...", default=None) 
     203    p.add_option("-s", "--symlink", dest="symlinkpattern", metavar="FILEPATTERN", action="store", help="""Create a symlink pointing to the most recent log file (of each virtual host if you use %v). Needs a filename pattern for the symlink (e.g. %v/access.log or symlinks/access-%v.log). Only "%v" is allowed in the pattern as symlinks which include time/date data are useless.""", default=None) 
     204    p.add_option("-x", "--execute", dest="execute", metavar="COMMAND", type="string", action="store", help="After writing to a logfile is finished and a new one is created (e.g. after rotating the logs), the given executable is started with the finished logfile as its first (and only) parameter. You could use gzip, bzip2, a self-written bash-script or even rm here.", default=None) 
    205205    #TODO: What happens with execute's output? 
    206206    (options, args) = p.parse_args()