diff --git a/main.py b/main.py index c2ed17d..7b6e98c 100755 --- a/main.py +++ b/main.py @@ -261,7 +261,9 @@ def fetch(replay: str, cache: bool = True) -> Replay: def main(): parser = argparse.ArgumentParser( - prog=APP, description="extracts stats from a Showdown replay" + prog=APP, + description="extracts stats from a Showdown replay", + formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) parser.add_argument("-v", "--verbose", action="count", help="add debugging info") parser.add_argument( @@ -270,6 +272,14 @@ def main(): action="store_true", help="fetch replays instead of using cache", ) + parser.add_argument( + "-o", + "--output", + action="store", + metavar="FILE", + default="data.db", + help="output data file", + ) parser.add_argument("replay", nargs="+", help="replay ID or URL") args = parser.parse_args(sys.argv[1:]) @@ -279,7 +289,7 @@ def main(): LOG.setLevel(logging.DEBUG) try: - db = sqlite3.connect("data.db") + db = sqlite3.connect(args.output) _init_db(db) for r in args.replay: