CLI: --help after a subcommand prints the usage

`vectorcraft-cli mcp --help` stopped with "unknown mcp option `--help`",
and `run`, `convert`, `info`, `bench` and `perf` treated `--help` and
`-h` as an unknown option or a file name, while `vectorcraft-cli help`
printed the usage. `--help` or `-h` after a subcommand now prints the
same usage and exits successfully, before the subcommand parses a value
or reads a file, so `run --commands missing.json --help` prints it too.
As the value of an option it stays that option's value: `run --cmd -h`
and `convert IN --range -h` still read `-h` as before.

The error for `--connect` with an automation root also had a run of 21
spaces in the middle of its text; it now has one.
This commit is contained in:
dotCooCoo
2026-10-24 05:23:58 -07:00
parent 21a648d850
commit d9891d9b2c
3 changed files with 107 additions and 6 deletions
+3
View File
@@ -341,6 +341,9 @@ fn deep(n: usize) -> Result<(), String> {
}
pub fn run(args: &[String]) -> Result<(), String> {
if crate::help_requested(args, &["--paths"]) {
return crate::help();
}
let mut n = 50_000usize;
let mut want_deep = false;
let mut it = args.iter();