diff options
Diffstat (limited to 'Biz/Dragons/main.py')
-rw-r--r-- | Biz/Dragons/main.py | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/Biz/Dragons/main.py b/Biz/Dragons/main.py index f85d9e7..e9df03f 100644 --- a/Biz/Dragons/main.py +++ b/Biz/Dragons/main.py @@ -225,27 +225,32 @@ def guard_git(repo: Repo) -> None: sys.exit(f"error: not a git repository: {repo}") -if __name__ == "__main__": - ARGS = get_args() - if ARGS.test: +def main() -> None: + """Entrypoint.""" + args = get_args() + if args.test: sys.stdout.write("ok") sys.exit() - logging.basicConfig(stream=sys.stderr, level=ARGS.verbosity.upper()) + logging.basicConfig(stream=sys.stderr, level=args.verbosity.upper()) logging.debug("starting") - os.chdir(pathlib.Path(ARGS.repo).resolve()) + os.chdir(pathlib.Path(args.repo).resolve()) - guard_git(ARGS.repo) + guard_git(args.repo) # if no active users provided, load from .mailmap - if ARGS.active_users == [] and pathlib.Path(".mailmap").exists(): - ARGS.active_users = mailmap_users() + if args.active_users == [] and pathlib.Path(".mailmap").exists(): + args.active_users = mailmap_users() # collect data - REPO = Repo(ARGS.ignored, ARGS.active_users) + repo = Repo(args.ignored, args.active_users) # print data - REPO.print_score() - REPO.print_blackholes(full=ARGS.blackholes) - REPO.print_liabilities(full=ARGS.liabilities) - REPO.print_stale(full=ARGS.stale) + repo.print_score() + repo.print_blackholes(full=args.blackholes) + repo.print_liabilities(full=args.liabilities) + repo.print_stale(full=args.stale) + + +if __name__ == "__main__": + main() |