Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added -v, --version command line option #273

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
),
formatter_class=RawTextHelpFormatter,
)
parser.add_argument("-v", "--version", action='store_true',
R1kaB3rN marked this conversation as resolved.
Show resolved Hide resolved
help="show this version and exit"
)
parser.add_argument(
"--config", help=("path to TOML file (requires Python 3.11+)")
)
Expand All @@ -77,6 +80,18 @@
parser.print_help(sys.stderr)
sys.exit(1)

# Show version
# Need to avoid clashes with later options (for example: wineboot -u)
# but parse_args scans the whole command line.
# So look at the first argument and see if we have -v or --version
# in sort of the same way parse_args would.
if sys.argv[1].lower().endswith(("--version", "-v")):
print(
f"umu-launcher version {__version__} ({sys.version})",

Check failure on line 90 in umu/umu_run.py

View workflow job for this annotation

GitHub Actions / build (3.10)

Ruff (W291)

umu/umu_run.py:90:67: W291 Trailing whitespace

Check failure on line 90 in umu/umu_run.py

View workflow job for this annotation

GitHub Actions / build (3.11)

Ruff (W291)

umu/umu_run.py:90:67: W291 Trailing whitespace

Check failure on line 90 in umu/umu_run.py

View workflow job for this annotation

GitHub Actions / build (3.12)

Ruff (W291)

umu/umu_run.py:90:67: W291 Trailing whitespace
file=sys.stderr
)
sys.exit(0)

# Winetricks
# Exit if no winetricks verbs were passed
if sys.argv[1].endswith("winetricks") and not sys.argv[2:]:
Expand Down
Loading