Skip to content

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

Open
aznohonza wants to merge 2 commits into
ProjectLeonida:mainfrom
aznohonza:scripts/entry-point-help
Open

aznohonza wants to merge 2 commits into
ProjectLeonida:mainfrom
aznohonza:scripts/entry-point-help

Conversation

@aznohonza

Copy link
Copy Markdown
Contributor

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)

check_no_game_data.py read `--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 it already carries and exits 0. play-linux.sh and
run_wine_session.sh print their usage before any environment check, where they used to answer with an error
(and play-linux.sh's no-argument case still prints the same usage, on stderr, exit 2).

run_game_wine.sh's one-line Usage line names the required --shaders, which its Inputs section already listed.

A test per script fails on main's copies and passes here.
…ME_DIR

Dropping -h from run_wine_session.sh or check_no_game_data.py now fails the
test that covers it, and play-linux.sh's usage lists LEONIDA_GAME_DIR with
the other path variables (it already honours it).

AI-assisted.

@KelboLive KelboLive left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants