Skip to content

Commit 964575d

Browse files
committed
fix: override clap long version envs
1 parent 9d4ce99 commit 964575d

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

crates/op-rbuilder/src/args/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
22
builders::BuilderMode,
3-
metrics::{CARGO_PKG_VERSION, VERGEN_GIT_SHA},
3+
metrics::{LONG_VERSION, SHORT_VERSION},
44
};
55
use clap_builder::{CommandFactory, FromArgMatches};
66
pub use op::{FlashblocksArgs, OpRbuilderArgs, TelemetryArgs};
@@ -82,7 +82,8 @@ impl CliExt for Cli {
8282
/// Parses commands and overrides versions
8383
fn set_version() -> Self {
8484
let matches = Cli::command()
85-
.version(format!("{CARGO_PKG_VERSION} ({VERGEN_GIT_SHA})"))
85+
.version(SHORT_VERSION)
86+
.long_version(LONG_VERSION)
8687
.about("Block builder designed for the Optimism stack")
8788
.author("Flashbots")
8889
.name("op-rbuilder")

crates/op-rbuilder/src/metrics.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ pub const VERGEN_CARGO_FEATURES: &str = env!("VERGEN_CARGO_FEATURES");
2424
/// The build profile name.
2525
pub const BUILD_PROFILE_NAME: &str = env!("OP_RBUILDER_BUILD_PROFILE");
2626

27+
/// The short version information for op-rbuilder.
28+
pub const SHORT_VERSION: &str = env!("OP_RBUILDER_SHORT_VERSION");
29+
30+
/// The long version information for op-rbuilder.
31+
pub const LONG_VERSION: &str = concat!(
32+
env!("OP_RBUILDER_LONG_VERSION_0"),
33+
"\n",
34+
env!("OP_RBUILDER_LONG_VERSION_1"),
35+
"\n",
36+
env!("OP_RBUILDER_LONG_VERSION_2"),
37+
"\n",
38+
env!("OP_RBUILDER_LONG_VERSION_3"),
39+
"\n",
40+
env!("OP_RBUILDER_LONG_VERSION_4"),
41+
);
42+
2743
pub const VERSION: VersionInfo = VersionInfo {
2844
version: CARGO_PKG_VERSION,
2945
build_timestamp: VERGEN_BUILD_TIMESTAMP,

0 commit comments

Comments
 (0)