def parse_args_or_exit(argv=None):
"""
Parse command line options
"""
parser = argparse.ArgumentParser(
description='CLI util to dump an xml blob of the xapi database to json')
parser.add_argument('--version', action='version',
version="%%(prog)s %s" %
pkg_resources.require("xapitodict")[0].version)
parser.add_argument(
"-v", "--print-db-version", dest="print_db", action='store_true',
help="Include the version metadata of the extracted xapi db "
"in the '_version' key")
parser.add_argument("xapi_db", metavar="XAPIDB",
help="Path to the xml dump of the xapi database")
parser.add_argument("-o", "--output", metavar="DEST",
dest="dest", default=None,
help="Path to the output json file. "
"Print to stdout when missing")
return parser.parse_args(argv)
评论列表
文章目录