From bcaf83532117c49e0f51864f59352630be1d0f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rust=E5=A4=A7=E9=97=B8=E8=9F=B9?= Date: Sat, 23 Jan 2021 03:14:51 +0800 Subject: build: Add additional build information to version and bug report (#2124) * fix https://github.com/starship/starship/issues * cargo fmt * upgrade shadow-rs 0.5.6 * upgrade shadow-rs * update * complet bug_report infomation * cargo fmt * upgrade shadow-rs 0.5.11 * upgrade shadow-rs 0.5.14 * fixed:https://github.com/starship/starship/pull/2124#discussion_r559076634 fixed:https://github.com/starship/starship/pull/2124#discussion_r559076918 * add long_version * upgrade shadow-rs 0.5.19; adaptate clap version() use by shadow-rs clap_version() * fix unit test error * fix test error * upgrade shadow-rs 0.5.22 * upgrade shadow-rs 0.5.23 --- src/main.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 1224e08a2..bbaa20fb4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use clap::{crate_authors, crate_version}; +use clap::crate_authors; use std::io; use std::time::SystemTime; @@ -29,11 +29,11 @@ fn main() { .takes_value(true); let shell_arg = Arg::with_name("shell") - .value_name("SHELL") - .help( - "The name of the currently running shell\nCurrently supported options: bash, zsh, fish, powershell, ion", - ) - .required(true); + .value_name("SHELL") + .help( + "The name of the currently running shell\nCurrently supported options: bash, zsh, fish, powershell, ion", + ) + .required(true); let cmd_duration_arg = Arg::with_name("cmd_duration") .short("d") @@ -61,10 +61,12 @@ fn main() { .long("print-full-init") .help("Print the main initialization script (as opposed to the init stub)"); + let long_version = crate::shadow::clap_version(); let mut app = App::new("starship") .about("The cross-shell prompt for astronauts. ☄🌌️") // pull the version number from Cargo.toml - .version(crate_version!()) + .version(shadow::PKG_VERSION) + .long_version(long_version.as_str()) // pull the authors from Cargo.toml .author(crate_authors!()) .after_help("https://github.com/starship/starship") -- cgit v1.2.3