Compare commits
3 commits
9bac43bf5d
...
ad7fc4e0cd
Author | SHA1 | Date | |
---|---|---|---|
ad7fc4e0cd | |||
0773529ba5 | |||
90e5eb8f79 |
3 changed files with 15 additions and 2 deletions
|
@ -20,7 +20,7 @@ path = "src/main.rs"
|
|||
|
||||
[dependencies]
|
||||
pico-args = "0.5.0"
|
||||
termion = "3.0.0"
|
||||
termion = "4.0.3"
|
||||
|
||||
[profile.release]
|
||||
opt-level = 's'
|
||||
|
|
|
@ -82,6 +82,13 @@ The rainbow flag designed for 2017 Philadelphia Pride.
|
|||
.It Ic transgender, trans
|
||||
The transgender pride flag designed by Monica Helms in 1999.
|
||||
.El
|
||||
.Sh ENVIRONMENT
|
||||
.Bl -tag -width Ds
|
||||
.It PRIDE_DEFAULT
|
||||
A string containing the name of a flag to use as the default when no
|
||||
.Ar flag
|
||||
argument is provided.
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
.Bl -tag -width Ds
|
||||
.It 1
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
//! main method module
|
||||
use std::env::var;
|
||||
|
||||
use pico_args::Arguments;
|
||||
|
||||
|
@ -50,7 +51,12 @@ fn main() {
|
|||
|
||||
let state = State::new(&mut args);
|
||||
|
||||
let subcommand = args.subcommand().unwrap();
|
||||
let subcommand =
|
||||
if let Ok(Some(subcommand)) = args.subcommand() { Some(subcommand) }
|
||||
else if let Ok(default) = var("PRIDE_DEFAULT") {
|
||||
if default.is_empty() { None }
|
||||
else { Some(default) }
|
||||
} else { None };
|
||||
let variant = args.subcommand().unwrap();
|
||||
|
||||
// get color vec from matched flag
|
||||
|
|
Loading…
Reference in a new issue