From 008ddf629812a6ead5bd2acfc8bc5f8d9bca300c Mon Sep 17 00:00:00 2001 From: xeals Date: Fri, 7 Apr 2023 09:16:15 +1000 Subject: [PATCH] move main file --- README.md | 6 ++++-- main.py => index.py | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) rename main.py => index.py (99%) diff --git a/README.md b/README.md index be80ea9..f5f4792 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ fuck. ## Usage ```sh -$ ./main.py -h -usage: hhirlstats [-h] [-v] [-C] [-o FILE] replay [replay ...] +$ ./index.py -h +usage: hhirlstats [-h] [-v] [-C] [-t FILE] [-o FILE] replay [replay ...] extracts stats from a Showdown replay @@ -23,6 +23,8 @@ options: -h, --help show this help message and exit -v, --verbose add debugging info (default: None) -C, --no-cache fetch replays instead of using cache (default: False) + -t FILE, --teams FILE + JSON file defining players to teams (default: teams.json) -o FILE, --output FILE output data file (default: data.db) ``` diff --git a/main.py b/index.py similarity index 99% rename from main.py rename to index.py index 50fd29f..3c505fe 100755 --- a/main.py +++ b/index.py @@ -493,7 +493,7 @@ def fetch(replay: str, cache: bool = True) -> Replay: return Replay(**data) # type: ignore -def main(args): +def main(): parser = argparse.ArgumentParser( prog=APP, description="extracts stats from a Showdown replay", @@ -524,7 +524,7 @@ def main(args): ) parser.add_argument("replay", nargs="+", help="replay ID or URL") - args = parser.parse_args(args) + args = parser.parse_args() if args.verbose and args.verbose > 1: LOG.setLevel(logging.TRACE) elif args.verbose: @@ -570,4 +570,4 @@ def main(args): if __name__ == "__main__": - main(sys.argv[1:]) + main()