zulip-export: Convert to using argparse from optparse.

This commit is contained in:
rht 2017-11-10 06:03:41 +01:00 committed by Tim Abbott
parent f689813f38
commit 5ff690d486
1 changed files with 4 additions and 5 deletions

View File

@ -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)