diff --git a/tools/zulip-export/zulip-export b/tools/zulip-export/zulip-export index 5249ec16d1..575a913ccb 100755 --- a/tools/zulip-export/zulip-export +++ b/tools/zulip-export/zulip-export @@ -23,7 +23,7 @@ import sys import os -import optparse +import argparse import time import json usage = """Export all messages on a given stream to a JSON dump. @@ -39,10 +39,9 @@ This script requires the Zulip API bindings to be installed.""" sys.path.append(os.path.join(os.path.dirname(__file__), '../../api')) import zulip -parser = optparse.OptionParser(usage=usage) -parser.add_option_group(zulip.generate_option_group(parser)) -parser.add_option('--stream', default='') -(options, args) = parser.parse_args() +parser = zulip.add_default_arguments(argparse.ArgumentParser(usage=usage)) +parser.add_argument('--stream', default='', action="store") +options = parser.parse_args() client = zulip.init_from_options(options)