1
1
// Copyright 2020 - Nym Technologies SA <[email protected] >
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
- use clap:: { App , ArgMatches } ;
4
+ use clap:: { crate_version , App , ArgMatches } ;
5
5
6
6
mod commands;
7
7
mod config;
@@ -14,7 +14,8 @@ async fn main() {
14
14
println ! ( "{}" , banner( ) ) ;
15
15
16
16
let arg_matches = App :: new ( "Nym Mixnet Gateway" )
17
- . version ( env ! ( "CARGO_PKG_VERSION" ) )
17
+ . version ( crate_version ! ( ) )
18
+ . long_version ( & * long_version ( ) )
18
19
. author ( "Nymtech" )
19
20
. about ( "Implementation of the Nym Mixnet Gateway" )
20
21
. subcommand ( commands:: init:: command_args ( ) )
@@ -53,7 +54,38 @@ fn banner() -> String {
53
54
(gateway - version {:})
54
55
55
56
"# ,
56
- env!( "CARGO_PKG_VERSION" )
57
+ crate_version!( )
58
+ )
59
+ }
60
+
61
+ fn long_version ( ) -> String {
62
+ format ! (
63
+ r#"
64
+ {:<20}{}
65
+ {:<20}{}
66
+ {:<20}{}
67
+ {:<20}{}
68
+ {:<20}{}
69
+ {:<20}{}
70
+ {:<20}{}
71
+ {:<20}{}
72
+ "# ,
73
+ "Build Timestamp:" ,
74
+ env!( "VERGEN_BUILD_TIMESTAMP" ) ,
75
+ "Build Version:" ,
76
+ env!( "VERGEN_BUILD_SEMVER" ) ,
77
+ "Commit SHA:" ,
78
+ env!( "VERGEN_GIT_SHA" ) ,
79
+ "Commit Date:" ,
80
+ env!( "VERGEN_GIT_COMMIT_TIMESTAMP" ) ,
81
+ "Commit Branch:" ,
82
+ env!( "VERGEN_GIT_BRANCH" ) ,
83
+ "rustc Version:" ,
84
+ env!( "VERGEN_RUSTC_SEMVER" ) ,
85
+ "rustc Channel:" ,
86
+ env!( "VERGEN_RUSTC_CHANNEL" ) ,
87
+ "cargo Profile:" ,
88
+ env!( "VERGEN_CARGO_PROFILE" ) ,
57
89
)
58
90
}
59
91
0 commit comments