@@ -29,6 +29,7 @@ use clarity::util::hash::Sha256Sum;
29
29
use clarity:: util:: secp256k1:: MessageSignature ;
30
30
use clarity:: vm:: types:: { QualifiedContractIdentifier , TupleData } ;
31
31
use clarity:: vm:: Value ;
32
+ use lazy_static:: lazy_static;
32
33
use serde:: { Deserialize , Serialize } ;
33
34
use stacks_common:: address:: {
34
35
b58, AddressHashMode , C32_ADDRESS_VERSION_MAINNET_MULTISIG ,
@@ -40,8 +41,34 @@ use stacks_common::types::chainstate::StacksPrivateKey;
40
41
41
42
extern crate alloc;
42
43
44
+ const GIT_BRANCH : Option < & ' static str > = option_env ! ( "GIT_BRANCH" ) ;
45
+ const GIT_COMMIT : Option < & ' static str > = option_env ! ( "GIT_COMMIT" ) ;
46
+ #[ cfg( debug_assertions) ]
47
+ const BUILD_TYPE : & ' static str = "debug" ;
48
+ #[ cfg( not( debug_assertions) ) ]
49
+ const BUILD_TYPE : & ' static str = "release" ;
50
+
51
+ lazy_static ! {
52
+ static ref VERSION_STRING : String = {
53
+ let pkg_version = option_env!( "STACKS_NODE_VERSION" ) . unwrap_or( env!( "CARGO_PKG_VERSION" ) ) ;
54
+ let git_branch = GIT_BRANCH . unwrap_or( "" ) ;
55
+ let git_commit = GIT_COMMIT . unwrap_or( "" ) ;
56
+ format!(
57
+ "{} ({}:{}, {} build, {} [{}])" ,
58
+ pkg_version,
59
+ git_branch,
60
+ git_commit,
61
+ BUILD_TYPE ,
62
+ std:: env:: consts:: OS ,
63
+ std:: env:: consts:: ARCH
64
+ )
65
+ } ;
66
+ }
67
+
43
68
#[ derive( Parser , Debug ) ]
44
69
#[ command( author, version, about) ]
70
+ #[ command( long_version = VERSION_STRING . as_str( ) ) ]
71
+
45
72
/// The CLI arguments for the stacks signer
46
73
pub struct Cli {
47
74
/// Subcommand action to take
0 commit comments