summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorRust大闸蟹 <liaoymxsdl@sina.com>2021-01-23 03:14:51 +0800
committerGitHub <noreply@github.com>2021-01-22 20:14:51 +0100
commitbcaf83532117c49e0f51864f59352630be1d0f90 (patch)
treec2b420a064836ff788cc4914700f2b45b1a9ab2e /src/main.rs
parent5471007db928e5ad5bdaa24df54360451c9b4f18 (diff)
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
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs16
1 files changed, 9 insertions, 7 deletions
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")