scripts: --help answers in the Python and shell entry points #2966

Merged
aznohonza merged 2 commits from upstream-pr/2966 into main 2026-12-02 00:56:29 +00:00
aznohonza commented 2026-12-01 21:55:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aznohonza on 2026-12-01T21:55:59Z.


Re-created from the original #2853. aznohonza/mandy-contrib was made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (422 state cannot be changed). Same branch, same head 6da607c0968fd3b6bce7193ea58fc30e585aabc5. The original review thread is at #2853.
This head also carries 1228aad13, the two review nits: -h coverage in test_run_wine_session and test_check_no_game_data, and LEONIDA_GAME_DIR in play-linux.sh usage.


Claimed in the coordination issue as: ENTRY-POINT-HELP-PY-SH

What and why

KelboLive's 06:36 finding lists entry points that cannot produce help. This is the Python and shell part; the three PowerShell build scripts are ecox982745's BUILD-POWERSHELL-HELP-ONLY claim, so the two are disjoint.

  • scripts/check_no_game_data.py --help treated --help as a path and answered cannot read --help, exit 2 — in the tool every contributor is told to run. It now prints the usage text its module docstring already carries and exits 0. Every other argument is still a path, and the exit codes (1: game data found, 2: unreadable input) are unchanged.
  • scripts/play-linux.sh --help answered No --help, exit 1. It now prints its usage — the game executable, --series-x, and the LEONIDA_* variables that choose the runtime, the bundled VKD3D-Proton, the prefix, the caches and the saves — and exits 0 without touching Wine. No argument still prints the same usage, on stderr, exit 2, as before.
  • scripts/run_wine_session.sh --help exited 1 on the missing WINEPREFIX. It now prints its usage and exits 0 before that check.
  • scripts/run_game_wine.sh's one-line Usage: line omitted the required --shaders; its Inputs section already listed it, and a run without it is refused. The line names it now.

Left out on purpose: compute_workers_win.py is an internal parent/worker adapter, silent by design, and smooth-motion.ps1 plus game-gate.ps1's -Verb values are PowerShell, which this machine has no pwsh to run.

Tested

  • python -I tests/test_check_no_game_data.py 22 pass, tests/test_run_game_wine.py 9, tests/test_run_wine_session.py 5, tests/test_run_game_wine_safety.py 3, tests/test_leonida_launcher.py 15, and the new tests/test_play_linux.py 1.
  • Red before green: with the four scripts at main and only the tests changed, each new test fails — test_play_linux.py 2, test_run_wine_session.py 1, test_check_no_game_data.py 1, test_run_game_wine.py 1 — and all pass with the scripts.
  • By hand: python3 -I scripts/check_no_game_data.py --help, sh scripts/play-linux.sh --help and bash scripts/run_wine_session.sh --help print their usage and exit 0; bash scripts/run_game_wine.sh --help's first line now names --shaders.
  • sh -n on play-linux.sh, bash -n on run_wine_session.sh and run_game_wine.sh, and python3 -I scripts/check_no_game_data.py on all eight changed files is clean.

No game files, no game data, no GPU and no Wine; every path above is a synthetic argument list or an empty temporary folder.

GPUs tested: none needed (tools only).

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md. (n/a: tools help only)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5595282601 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2966). Originally posted by [aznohonza](https://github.com/aznohonza) on 2026-12-01T21:55:59Z. --- Re-created from the original #2853. `aznohonza/mandy-contrib` was made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (`422 state cannot be changed`). Same branch, same head `6da607c0968fd3b6bce7193ea58fc30e585aabc5`. The original review thread is at #2853. This head also carries `1228aad13`, the two review nits: `-h` coverage in `test_run_wine_session` and `test_check_no_game_data`, and `LEONIDA_GAME_DIR` in `play-linux.sh` usage. --- Claimed in the coordination issue as: [ENTRY-POINT-HELP-PY-SH](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7306722538) ### What and why [KelboLive's 06:36 finding](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7303072585) lists entry points that cannot produce help. This is the Python and shell part; the three PowerShell build scripts are [ecox982745's `BUILD-POWERSHELL-HELP-ONLY` claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7303812387), so the two are disjoint. - `scripts/check_no_game_data.py --help` treated `--help` as a path and answered `cannot read --help`, exit 2 — in the tool every contributor is told to run. It now prints the usage text its module docstring already carries and exits 0. Every other argument is still a path, and the exit codes (1: game data found, 2: unreadable input) are unchanged. - `scripts/play-linux.sh --help` answered `No --help`, exit 1. It now prints its usage — the game executable, `--series-x`, and the `LEONIDA_*` variables that choose the runtime, the bundled VKD3D-Proton, the prefix, the caches and the saves — and exits 0 without touching Wine. No argument still prints the same usage, on stderr, exit 2, as before. - `scripts/run_wine_session.sh --help` exited 1 on the missing `WINEPREFIX`. It now prints its usage and exits 0 before that check. - `scripts/run_game_wine.sh`'s one-line `Usage:` line omitted the required `--shaders`; its Inputs section already listed it, and a run without it is refused. The line names it now. Left out on purpose: `compute_workers_win.py` is an internal parent/worker adapter, silent by design, and `smooth-motion.ps1` plus `game-gate.ps1`'s `-Verb` values are PowerShell, which this machine has no `pwsh` to run. ### Tested - `python -I tests/test_check_no_game_data.py` 22 pass, `tests/test_run_game_wine.py` 9, `tests/test_run_wine_session.py` 5, `tests/test_run_game_wine_safety.py` 3, `tests/test_leonida_launcher.py` 15, and the new `tests/test_play_linux.py` 1. - Red before green: with the four scripts at `main` and only the tests changed, each new test fails — `test_play_linux.py` 2, `test_run_wine_session.py` 1, `test_check_no_game_data.py` 1, `test_run_game_wine.py` 1 — and all pass with the scripts. - By hand: `python3 -I scripts/check_no_game_data.py --help`, `sh scripts/play-linux.sh --help` and `bash scripts/run_wine_session.sh --help` print their usage and exit 0; `bash scripts/run_game_wine.sh --help`'s first line now names `--shaders`. - `sh -n` on `play-linux.sh`, `bash -n` on `run_wine_session.sh` and `run_game_wine.sh`, and `python3 -I scripts/check_no_game_data.py` on all eight changed files is clean. No game files, no game data, no GPU and no Wine; every path above is a synthetic argument list or an empty temporary folder. GPUs tested: none needed (tools only). AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption. - [x] A new translator rule is in the contract table of `docs/design.md`. (n/a: tools help only)
KelboLive commented 2026-12-01 22:19:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T22:19:27Z.

Review: COMMENTED


This one changed since #2853: 1228aad13 fixes both nits I raised — -h is now covered in both shell tests, and play-linux.sh's usage names LEONIDA_GAME_DIR. Under WSL the suites are green (play_linux 1/1, run_wine_session 5/5, check_no_game_data 22/22), merge-tree is clean and keeps main's --cache default. Good to merge.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6141173013 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2966#pullrequestreview-6141173013). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T22:19:27Z. **Review:** COMMENTED --- This one changed since #2853: `1228aad13` fixes both nits I raised — `-h` is now covered in both shell tests, and `play-linux.sh`'s usage names `LEONIDA_GAME_DIR`. Under WSL the suites are green (play_linux 1/1, run_wine_session 5/5, check_no_game_data 22/22), `merge-tree` is clean and keeps main's `--cache` default. Good to merge.
aznohonza commented 2026-12-01 22:28:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aznohonza on 2026-12-01T22:28:20Z.


Thanks for the re-check and the WSL run — that matches the three suites here (play_linux 1/1, run_wine_session 5/5, check_no_game_data 22/22), and 1228aad13 is the head. Nothing else on my side.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7327902998 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2966#issuecomment-7327902998). Originally posted by [aznohonza](https://github.com/aznohonza) on 2026-12-01T22:28:20Z. --- Thanks for the re-check and the WSL run — that matches the three suites here (play_linux 1/1, run_wine_session 5/5, check_no_game_data 22/22), and `1228aad13` is the head. Nothing else on my side. AI-assisted.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2966
No description provided.