From c547fe2e7193e527668a9826dd955d8a70108b29 Mon Sep 17 00:00:00 2001 From: pickworthi Date: Wed, 13 Nov 2024 16:45:57 +0000 Subject: [PATCH] Added -v, --version command line option --- umu/umu_run.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/umu/umu_run.py b/umu/umu_run.py index 72e479cf1..fdce181ef 100755 --- a/umu/umu_run.py +++ b/umu/umu_run.py @@ -63,6 +63,9 @@ def parse_args() -> Namespace | tuple[str, list[str]]: # noqa: D103 ), formatter_class=RawTextHelpFormatter, ) + parser.add_argument("-v", "--version", action='store_true', + help="show the version and exit" + ) parser.add_argument( "--config", help=("path to TOML file (requires Python 3.11+)") ) @@ -77,6 +80,11 @@ def parse_args() -> Namespace | tuple[str, list[str]]: # noqa: D103 parser.print_help(sys.stderr) sys.exit(1) + c_args = parser.parse_args() + if c_args.version: + print(f"umu-launcher version {__version__} ({sys.version})", file=sys.stderr) + sys.exit(1) + # Winetricks # Exit if no winetricks verbs were passed if sys.argv[1].endswith("winetricks") and not sys.argv[2:]: