mirror of https://github.com/zulip/zulip.git
zulip-export: Convert to using argparse from optparse.
This commit is contained in:
parent
f689813f38
commit
5ff690d486
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue