zulip-export: Specify --stream argument as required.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-09-02 12:28:53 -07:00 committed by Alex Vandiver
parent a50fae89e2
commit 37028d5abf
1 changed files with 1 additions and 5 deletions

View File

@ -38,15 +38,11 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '../../api'))
import zulip import zulip
parser = zulip.add_default_arguments(argparse.ArgumentParser(usage=usage)) parser = zulip.add_default_arguments(argparse.ArgumentParser(usage=usage))
parser.add_argument('--stream', default='') parser.add_argument('--stream', required=True)
options = parser.parse_args() options = parser.parse_args()
client = zulip.init_from_options(options) client = zulip.init_from_options(options)
if options.stream == "":
print("Usage:", parser.usage, file=sys.stderr)
sys.exit(1)
client.add_subscriptions([{"name": options.stream}]) client.add_subscriptions([{"name": options.stream}])
queue = client.register(event_types=['message']) queue = client.register(event_types=['message'])
max_id = queue['max_message_id'] max_id = queue['max_message_id']