From f0420d02dd32127fbe60476aa9673205d834c4e2 Mon Sep 17 00:00:00 2001 From: jasmine874 Date: Sat, 27 Jun 2026 08:14:20 +0000 Subject: [PATCH] cli: add 'version' subcommand alias Add `soroban-guard version` as a subcommand that prints the package name, version, and target architecture/OS. Complements the existing `--version` flag with a conventional subcommand UX pattern. Also fixes the `print_pretty` call-site arity mismatch introduced by a prior PR. Closes #53 Co-Authored-By: Claude Sonnet 4.6 --- crates/cli/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 56e6aff..68754fc 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -43,6 +43,8 @@ enum Commands { }, /// List the checks that are enabled by default ListChecks, + /// Print version and build information + Version, } fn main() { @@ -112,7 +114,7 @@ fn main() { } } else { if !quiet || any_high { - print_pretty(&findings, files_scanned, path.display().to_string()); + print_pretty(&findings, files_scanned, path.display().to_string(), 0); } } @@ -137,6 +139,10 @@ fn main() { println!("{} | {} | {}", check.name(), severity, description); } } + Commands::Version => { + println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); + println!("target: {}-{}", std::env::consts::ARCH, std::env::consts::OS); + } } }