From 5ff690d48652205e34f9630d47ea2b839b458603 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 10 Nov 2017 06:03:41 +0100 Subject: [PATCH] zulip-export: Convert to using argparse from optparse. --- tools/zulip-export/zulip-export | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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)