extract args

This commit is contained in:
xeals 2023-03-28 00:26:51 +11:00
parent 1e04b57a50
commit 0218386906
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C

View File

@ -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:])