From 0218386906fe222d3fc106da35915e6f7eecc48d Mon Sep 17 00:00:00 2001 From: xeals Date: Tue, 28 Mar 2023 00:26:51 +1100 Subject: [PATCH] extract args --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 7b6e98c..c0b6f5a 100755 --- a/main.py +++ b/main.py @@ -259,7 +259,7 @@ def fetch(replay: str, cache: bool = True) -> Replay: return Replay(**data) -def main(): +def main(args): parser = argparse.ArgumentParser( prog=APP, description="extracts stats from a Showdown replay", @@ -282,7 +282,7 @@ def main(): ) parser.add_argument("replay", nargs="+", help="replay ID or URL") - args = parser.parse_args(sys.argv[1:]) + args = parser.parse_args(args) if args.verbose and args.verbose > 1: LOG.setLevel(logging.TRACE) elif args.verbose: @@ -317,4 +317,4 @@ def main(): if __name__ == "__main__": - main() + main(sys.argv[1:])