diff --git a/cmd/soroban-cli/src/commands/version.rs b/cmd/soroban-cli/src/commands/version.rs index e06970a59..7b9670af6 100644 --- a/cmd/soroban-cli/src/commands/version.rs +++ b/cmd/soroban-cli/src/commands/version.rs @@ -39,8 +39,14 @@ pub fn git() -> &'static str { pub fn long() -> String { let xdr = stellar_xdr::VERSION; + let git_rev = if git().is_empty() { + String::new() + } else { + format!(" ({})", git()) + }; + [ - format!("{} ({})", pkg(), git()), + format!("{}{git_rev}", pkg()), format!( "stellar-xdr {} ({}) xdr curr ({})",