diff --git a/src/resetTolkien/cli.py b/src/resetTolkien/cli.py index a8cdb9d..1bdacad 100644 --- a/src/resetTolkien/cli.py +++ b/src/resetTolkien/cli.py @@ -5,6 +5,7 @@ import datetime from resetTolkien.resetTolkien import ResetTolkien +from resetTolkien import version from resetTolkien.format import Formatter from resetTolkien.utils import SplitArgs, SERVER_DATE_FORMAT, server_date_example from resetTolkien.constants import ( @@ -88,6 +89,10 @@ main_parser = argparse.ArgumentParser(description=PROG_DESCRIPTION) action_subparser = main_parser.add_subparsers(title="action", dest="action") +main_parser.add_argument( + "-v", "--version", help="Print tool version", action="store_true" +) + # DETECT detect_parser = action_subparser.add_parser( @@ -254,6 +259,10 @@ def main(): args = main_parser.parse_args() + if args.version: + print(version) + exit() + if not args.action: main_parser.print_help() exit()