CLI: --help prints usage to stdout and exits 0 (#1818) (#1828)

* claim: #1818

* claim: #1818

* fix(cli): --help, -h and help print usage to stdout and exit 0 (#1818)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
This commit is contained in:
DuBearte
2026-10-21 20:39:30 +00:00
committed by GitHub
parent 84ec512d7a
commit c54b711345
2 changed files with 29 additions and 0 deletions
+6
View File
@@ -140,6 +140,12 @@ fn main() -> ExitCode {
println!("solidcraft-cli {}", env!("CARGO_PKG_VERSION"));
Ok(())
}
// Asked-for help is not an error: usage on stdout, exit 0.
Some("--help" | "-h" | "help") => {
use std::io::Write as _;
let _ = std::io::stdout().lock().write_all(USAGE.as_bytes());
Ok(())
}
_ => Err(USAGE.to_string()),
};
match r {