mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
main: Display git commit hash with the '--version' option
Add a build-script to propagate the git commit hash to other crates at compile time through environment variables, and display the hash along with the '--version' option. Fixes #729 Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
extern crate vmm;
|
||||
extern crate vmm_sys_util;
|
||||
|
||||
#[macro_use(crate_version, crate_authors)]
|
||||
#[macro_use(crate_authors)]
|
||||
extern crate clap;
|
||||
|
||||
use clap::{App, Arg, ArgGroup, ArgMatches};
|
||||
@@ -78,7 +78,9 @@ fn create_app<'a, 'b>(
|
||||
api_server_path: &'a str,
|
||||
) -> App<'a, 'b> {
|
||||
App::new("cloud-hypervisor")
|
||||
.version(crate_version!())
|
||||
// 'BUILT_VERSION' is set by the build script 'build.rs' at
|
||||
// compile time
|
||||
.version(env!("BUILT_VERSION"))
|
||||
.author(crate_authors!())
|
||||
.about("Launch a cloud-hypervisor VMM.")
|
||||
.group(ArgGroup::with_name("vm-config").multiple(true))
|
||||
|
||||
Reference in New Issue
Block a user