diff options
author | Matan Kushner <hello@matchai.me> | 2019-04-03 22:57:50 -0400 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-04-03 22:58:13 -0400 |
commit | e519c3f4a6ff633eb049f7fa57a3c06e032466b2 (patch) | |
tree | 4da350822c75b28428eb8abfc2129be2e9d63e99 /src/main.rs | |
parent | e2ba7a13542c0fcefee3e6e85d8b0bf3ec6c8265 (diff) |
Set status with arg rather than env
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index ab7e04e56..7cbe7d225 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ mod modules; mod print; use ansi_term::Style; -use clap::App; +use clap::{App, Arg}; pub struct Segment { style: Style, @@ -16,14 +16,19 @@ pub struct Segment { } fn main() { - App::new("Starship") + let args = App::new("Starship") .about("The cross-platform prompt for astronauts. ✨🚀") // pull the version number from Cargo.toml .version(crate_version!()) // pull the authors from Cargo.toml .author(crate_authors!()) .after_help("https://github.com/matchai/starship") + .arg( + Arg::with_name("status_code") + .help("The status code of the previously run command") + .required(true), + ) .get_matches(); - print::prompt(); + print::prompt(args); } |