Mercurial > hg > autobot
changeset 301:aec0a7f8c191
STUB: autobot/template/restart_buildbot.py
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 11 May 2014 09:48:20 -0700 |
parents | aeaf4494c7d8 |
children | 8bc0160993a2 |
files | autobot/template/restart_buildbot.py |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/autobot/template/restart_buildbot.py Sun May 11 09:45:14 2014 -0700 +++ b/autobot/template/restart_buildbot.py Sun May 11 09:48:20 2014 -0700 @@ -2,26 +2,26 @@ """(re)start the buildbot""" -import optparse +import argparse import os import sys from subprocess import call -from time import sleep here = os.path.abspath(os.path.dirname(sys.argv[0])) debug = {{debug}} + def main(args=sys.argv[1:]): + """CLI""" # parse command line options - usage = '%prog [options]' - parser = optparse.OptionParser(usage=usage, description=__doc__) - parser.add_option('--stop', dest='stop', + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--stop', dest='stop', action='store_true', default=False, - help="stop the buildbot only") - # could force a build here - # buildbot sendchange ... - options, args = parser.parse_args(args) + help="stop the buildbot only; don't restart") + # TODO: could force a build here: + # buildbot sendchange ... + options = parser.parse_args(args) # cleanup if debug: