--wait option added

Wait time between two refresh is now an option
This commit is contained in:
Alexandre Dulaunoy 2011-03-05 17:02:47 +01:00
parent 2e4f6da143
commit 4568b5b865

View file

@ -32,6 +32,7 @@ parser = OptionParser(usage)
parser.add_option("-s", "--state", action="store_true" ,dest="state", help="keep state of existing rcline seen and don't output them", default=False) parser.add_option("-s", "--state", action="store_true" ,dest="state", help="keep state of existing rcline seen and don't output them", default=False)
parser.add_option("-c", "--cleanstate", dest="statesec", help="expire states existing more than number of seconds specified") parser.add_option("-c", "--cleanstate", dest="statesec", help="expire states existing more than number of seconds specified")
parser.add_option("-t", "--tail", action="store_true", dest="tail", help="tail-like operation by continuously appending new changes (--state option is enable)", default=False) parser.add_option("-t", "--tail", action="store_true", dest="tail", help="tail-like operation by continuously appending new changes (--state option is enable)", default=False)
parser.add_option("-w", "--wait", dest="wait", help="number of seconds to wait before refreshing (default is 60)", default=60)
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if (options.tail): if (options.tail):
@ -73,7 +74,7 @@ def core ():
else: else:
print rcline print rcline
if x > 1: if x > 1:
time.sleep(60) time.sleep(float(options.wait))
if (options.state): if (options.state):
s.close() s.close()