From beb2a6570fe84af62b9cccb959d9360ea44856cd Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 20 Mar 2017 12:14:38 -0700 Subject: [PATCH] sync_public_streams: Use option group for arguments. --- bots/sync-public-streams | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bots/sync-public-streams b/bots/sync-public-streams index 9cb96af..345fc60 100755 --- a/bots/sync-public-streams +++ b/bots/sync-public-streams @@ -2,6 +2,7 @@ import sys import os import logging +import optparse import time import simplejson import subprocess @@ -12,8 +13,6 @@ import zulip from typing import Set -zulip_client = zulip.Client(client="ZulipSyncPublicStreamsBot/0.1") - def fetch_public_streams(): # type: () -> Set[str] public_streams = set() @@ -56,6 +55,12 @@ if __name__ == "__main__": file_handler.setFormatter(formatter) logger.addHandler(file_handler) + parser = optparse.OptionParser() + parser.add_option_group(zulip.generate_option_group(parser)) + (options, args) = parser.parse_args() + + zulip_client = zulip.Client(client="ZulipSyncPublicStreamsBot/0.1") + while True: time.sleep(15) public_streams = fetch_public_streams()