feat(bundle) add version to cargo-tauri-bundle subcommand (#31)

This commit is contained in:
Lucas Fernandes Nogueira 2019-08-24 15:14:08 -03:00 committed by nothingismagick
parent 9559f6f999
commit af41c71967

View File

@ -120,11 +120,21 @@ fn run() -> crate::Result<()> {
.value_name("FEATURES")
.multiple(true)
.help("Which features to build"),
)
.arg(
Arg::with_name("version")
.long("version")
.short("v")
.help("Read the version of the CLI"),
),
)
.get_matches();
if let Some(m) = m.subcommand_matches("tauri-bundle") {
if m.is_present("version") {
println!("{}", crate_version!());
}
else {
let output_paths = env::current_dir()
.map_err(From::from)
.and_then(|d| Settings::new(d, m))
@ -135,6 +145,7 @@ fn run() -> crate::Result<()> {
.and_then(bundle_project)?;
bundle::print_finished(&output_paths)?;
}
}
Ok(())
}