Mercurial > hg > CommitWatcher
diff commitwatcher/main.py @ 2:4cb3971d9d9d
commitwatcher/__init__.py commitwatcher/agent.py commitwatcher/main.py setup.py commitwatcher/commit.py commitwatcher/store.py mozbasewatcher.py
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 26 Sep 2013 21:35:29 -0700 |
parents | bdc039cb1f2e |
children |
line wrap: on
line diff
--- a/commitwatcher/main.py Thu Sep 26 05:11:57 2013 -0700 +++ b/commitwatcher/main.py Thu Sep 26 21:35:29 2013 -0700 @@ -10,13 +10,15 @@ import subprocess import sys +from .agent import FeedAgent + def add_options(parser): """add options to the OptionParser instance""" def main(args=sys.argv[1:]): # parse command line options - usage = '%prog [options] ...' + usage = '%prog [options] url://of.repository/' class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): """description formatter for console script entry point""" def format_description(self, description): @@ -26,6 +28,15 @@ return '' parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) options, args = parser.parse_args(args) + if len(args) != 1: + parser.error("Please specify a single repository") + # TODO : multiple repos + + repo = args[0] + + # watch the damn thing + watcher = FeedAgent(repository=repo) + watcher.update() if __name__ == '__main__': main()