Reproduce
$ launchbound-tui --help
Error: run dir: --help/verdicts.json: No such file or directory (os error 2) (stage writes it)
Every conventional form does the same — the flag is taken as a path:
| argument |
result |
--help |
run dir: --help/verdicts.json: No such file... |
-h |
run dir: -h/verdicts.json: No such file... |
--version |
run dir: --version/verdicts.json: No such file... |
-V |
run dir: -V/verdicts.json: No such file... |
| (none) |
usage: launchbound-tui <run-dir> |
Why
crates/launchbound-tui/src/main.rs:19 reads std::env::args() directly. There is no argument parsing, so nothing distinguishes a flag from a path.
Why it matters
launchbound-tui is published — crates.io shows 1.2.0 with 66 downloads — so this is what an installed user gets. --help is the first thing anyone types at an unfamiliar binary, and the reply is an error about a file named --help, which reads as a bug in the tool rather than as "that flag does not exist".
It is also the only binary in the workspace that behaves this way: launchbound uses clap and answers --help and --version properly.
Fix
The bare-argument reading is fine for one positional — this does not need clap pulled in if that is unwanted. Two lines get most of the value:
match arg.as_deref() {
Some("-h" | "--help") => { print_usage(); return Ok(()); }
Some("-V" | "--version") => { println!("launchbound-tui {}", env!("CARGO_PKG_VERSION")); return Ok(()); }
Some(path) if path.starts_with('-') => bail!("unknown option `{path}`; usage: launchbound-tui <run-dir>"),
...
}
The usage text has somewhere useful to point, since the run directory comes from launchbound stage or launchbound tune:
usage: launchbound-tui <run-dir>
<run-dir> a directory written by `launchbound stage` or `launchbound tune`,
containing verdicts.json (and results.json once measured)
1 overview · 2 ranking · 3 rejections · 4 progress · j/k scroll · q quit
Rejecting any unrecognised leading-dash argument is the part that stops this recurring — otherwise --ascii or --no-color will land here next.
Done when
launchbound-tui --help and --version answer, and an unknown flag is reported as an unknown flag rather than as a missing directory.
Reproduce
Every conventional form does the same — the flag is taken as a path:
--helprun dir: --help/verdicts.json: No such file...-hrun dir: -h/verdicts.json: No such file...--versionrun dir: --version/verdicts.json: No such file...-Vrun dir: -V/verdicts.json: No such file...usage: launchbound-tui <run-dir>Why
crates/launchbound-tui/src/main.rs:19readsstd::env::args()directly. There is no argument parsing, so nothing distinguishes a flag from a path.Why it matters
launchbound-tuiis published — crates.io shows 1.2.0 with 66 downloads — so this is what an installed user gets.--helpis the first thing anyone types at an unfamiliar binary, and the reply is an error about a file named--help, which reads as a bug in the tool rather than as "that flag does not exist".It is also the only binary in the workspace that behaves this way:
launchbounduses clap and answers--helpand--versionproperly.Fix
The bare-argument reading is fine for one positional — this does not need clap pulled in if that is unwanted. Two lines get most of the value:
The usage text has somewhere useful to point, since the run directory comes from
launchbound stageorlaunchbound tune:Rejecting any unrecognised leading-dash argument is the part that stops this recurring — otherwise
--asciior--no-colorwill land here next.Done when
launchbound-tui --helpand--versionanswer, and an unknown flag is reported as an unknown flag rather than as a missing directory.