mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-28 03:37:00 -06:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user