From db3030a60fad1505934b3bb7a7eafafa0e704535 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:21:40 -0800 Subject: [PATCH] Make only one way to get the version of the CLI (#1100) --- cmd/soroban-cli/src/commands/mod.rs | 3 +-- cmd/soroban-cli/src/commands/version.rs | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cmd/soroban-cli/src/commands/mod.rs b/cmd/soroban-cli/src/commands/mod.rs index a9f668082..76152261d 100644 --- a/cmd/soroban-cli/src/commands/mod.rs +++ b/cmd/soroban-cli/src/commands/mod.rs @@ -45,9 +45,8 @@ Full CLI reference: https://github.com/stellar/soroban-tools/tree/main/docs/soro #[derive(Parser, Debug)] #[command( name = "soroban", - version = version::short(), - long_version = version::long(), about = ABOUT, + version = version::long(), long_about = ABOUT.to_string() + LONG_ABOUT, disable_help_subcommand = true, )] diff --git a/cmd/soroban-cli/src/commands/version.rs b/cmd/soroban-cli/src/commands/version.rs index e1c7204d7..d9fc091b2 100644 --- a/cmd/soroban-cli/src/commands/version.rs +++ b/cmd/soroban-cli/src/commands/version.rs @@ -15,15 +15,11 @@ impl Cmd { } } -pub fn short() -> String { - format!("{} ({GIT_REVISION})", env!("CARGO_PKG_VERSION")) -} - pub fn long() -> String { let env = soroban_env_host::VERSION; let xdr = soroban_env_host::VERSION.xdr; [ - short(), + format!("{} ({GIT_REVISION})", env!("CARGO_PKG_VERSION")), format!("soroban-env {} ({})", env.pkg, env.rev), format!("soroban-env interface version {}", meta::INTERFACE_VERSION), format!(