mirror of https://github.com/zulip/zulip.git
zulip-export: Specify --stream argument as required.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
a50fae89e2
commit
37028d5abf
|
@ -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']
|
||||||
|
|
Loading…
Reference in New Issue