File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
2222fn main ( ) -> Result < ( ) > {
2323 let args = arguments ( ) ?;
2424
25+
2526 let ( email, token, proxy) = args. http_config ( ) ?;
2627 let device = args. capture . device ( ) ?;
2728 let interface = args. capture . interface ( ) ?;
Original file line number Diff line number Diff line change 1+ use crate :: libkflow;
2+
13#[ derive( Clone , Debug ) ]
24pub struct Version {
3- pub name : String ,
5+ pub name : String ,
46 pub version : String ,
5- pub arch : String ,
6- pub system : String ,
7- pub commit : String ,
8- pub detail : String ,
7+ pub arch : String ,
8+ pub system : String ,
9+ pub commit : String ,
10+ pub detail : String ,
911}
1012
1113impl Version {
1214 pub fn new ( ) -> Self {
1315 let version = version ( ) ;
14- let commit = commit ( ) ;
15- let detail = format ! ( "{} ({})" , version, commit) ;
16+ let commit = commit ( ) ;
17+ let detail = format ! ( "{} ({})" , version, commit) ;
1618 Self {
17- name : env ! ( "CARGO_PKG_NAME" ) . to_owned ( ) ,
19+ name : env ! ( "CARGO_PKG_NAME" ) . to_owned ( ) ,
1820 version : version,
19- arch : arch ( ) ,
20- system : system ( ) ,
21- commit : commit,
22- detail : detail,
21+ arch : arch ( ) ,
22+ system : system ( ) ,
23+ commit : commit,
24+ detail : detail,
2325 }
24-
2526 }
2627}
2728
2829fn version ( ) -> String {
29- match option_env ! ( "BUILD_VERSION" ) {
30- Some ( version) => version,
31- None => env ! ( "CARGO_PKG_VERSION" ) ,
32- } . to_owned ( )
30+ let kprobe_version = option_env ! ( "BUILD_VERSION" )
31+ . unwrap_or_else ( || env ! ( "CARGO_PKG_VERSION" ) )
32+ . to_owned ( ) ;
33+ let libkflow_version = libkflow:: version ( ) ;
34+ format ! ( "{} (libkflow {})" , kprobe_version, libkflow_version)
3335}
3436
3537fn commit ( ) -> String {
36- option_env ! ( "BUILD_COMMIT" ) . unwrap_or ( "<unknown>" ) . to_owned ( )
38+ option_env ! ( "BUILD_COMMIT" )
39+ . unwrap_or ( "<unknown>" )
40+ . to_owned ( )
3741}
3842
3943fn arch ( ) -> String {
4044 option_env ! ( "BUILD_ARCH" ) . unwrap_or ( "<unknown>" ) . to_owned ( )
4145}
4246
4347fn system ( ) -> String {
44- option_env ! ( "BUILD_SYSTEM" ) . unwrap_or ( "<unknown>" ) . to_owned ( )
48+ option_env ! ( "BUILD_SYSTEM" )
49+ . unwrap_or ( "<unknown>" )
50+ . to_owned ( )
4551}
You can’t perform that action at this time.
0 commit comments