Compare commits

...

2 commits

3 changed files with 94 additions and 44 deletions

View file

@ -83,6 +83,14 @@ pub fn genderfluid() -> Colors {
vec![pink, WHITE, violet, BLACK, blue]
}
pub fn gender_nonconforming() -> Colors {
let purple = rgb(0x50284D);
let magenta = rgb(0x96467B);
let blue = rgb(0x5C96F7);
vec![purple, purple, magenta, blue, WHITE, blue, magenta, purple, purple]
}
pub fn genderqueer() -> Colors {
let purple = rgb(0xB899DF);
let green = rgb(0x6B8E3B);

77
src/help.rs Normal file
View file

@ -0,0 +1,77 @@
use crate::VERSION;
pub fn help_text() {
println!("pride v{VERSION}
Valerie Wolfe <sleeplessval@gmail.com>
Display pride flags in the terminal.
usage: pride [flags] [name]
args:
<name> The pride flag to display
flags:
-h, --help Shows this help text
--version Show version information
-l, --list Prints a list of printable flags
-s, --small Prints a small version without holding
Use 'pride --list' to see a list of printable flags
~ You're loved and you matter ");
}
pub fn list_text() {
println!("pride v{VERSION}
flag list:
agender agender pride flag
aro, aromantic aromantic pride flag
ace, asexual asexual pride flag
bigender bigender pride flag
bi, bisexual bisexual pride flag
gay, mlm gay men pride flag
genderfluid genderfluid pride flag
gender-nonconforming gender nonconforming pride flag
genderqueer genderqueer pride flag
gendervoid gendervoid pride flag
lesbian lesbian pride flag
multigender multigender pride flag
nb, nonbinary nonbinary pride flag
pan, pansexual pansexual pride flag
pride, rainbow six-color rainbow flag
trans, transgender transgender pride flag");
}
pub fn flag_help(flag: &str) {
match flag {
"pride" | "rainbow"
=> {
println!("The ubiquitous 1979 6-color rainbow pride flag, representing the larger queer community.
names:
'pride', 'rainbow'
variants:
8-color Gilbert Baker's original 1978 flag with 8 stripes
gilbert-baker
sex-and-magic
philadelphia The 2017 Philadelphia Pride flag with black and brown stripes");
},
"transgender" | "trans"
=> {
println!("The transgender pride flag designed by Monica Helms in 1999.
names:
'transgender', 'trans'
");
}
_
=> help_text()
}
}

View file

@ -5,6 +5,7 @@ use pico_args::Arguments;
mod color;
mod draw;
mod flag;
mod help;
mod variant;
use crate::color::Colors;
@ -17,13 +18,15 @@ fn main() {
// handle help flag
if args.contains(["-h", "--help"]) {
help_text();
let target = args.subcommand().unwrap();
if target.is_some() { help::flag_help(&target.unwrap()); }
else { help::help_text(); }
return;
}
// handle list flag
if args.contains(["-l", "--list"]) {
list_text();
help::list_text();
return;
}
@ -79,6 +82,9 @@ fn main() {
Some("genderfluid")
=> flag::genderfluid(),
Some("gender-nonconforming" | "gnc" | "gendernonconforming")
=> flag::gender_nonconforming(),
Some("genderqueer")
=> flag::genderqueer(),
@ -97,7 +103,7 @@ fn main() {
Some("pansexual" | "pan")
=> flag::pansexual(),
_ => { help_text(); exit(1) } // (or die)
_ => { help::help_text(); exit(1) } // (or die)
};
if small { draw::small(colors); }
@ -105,44 +111,3 @@ fn main() {
}
fn help_text() {
println!("pride v{VERSION}");
println!("Valerie Wolfe <sleeplessval@gmail.com>");
println!("Show pride flags in the terminal.\n");
println!("usage: pride [flags] [name]\n");
println!("args:");
println!(" <name> The pride flag to display\n");
println!("flags:");
println!(" -h, --help Shows this help text");
println!(" --version Show version information");
println!(" -l, --list Prints a list of printable flags");
println!(" -s, --small Prints a small version without holding");
println!("\nUse 'pride --list' to see a list of printable flags");
println!("\n~ You're loved and you matter ♥");
}
fn list_text() {
println!("pride v{}", env!("CARGO_PKG_VERSION"));
println!("\nFlag list:");
println!(" agender agender pride flag");
println!(" aro, aromantic aromantic pride flag");
println!(" ace, asexual asexual pride flag");
println!(" bigender bigender pride flag");
println!(" bi, bisexual bisexual pride flag");
println!(" gay, mlm gay men pride flag");
println!(" genderfluid genderfluid pride flag");
println!(" genderqueer genderqueer pride flag");
println!(" gendervoid gendervoid pride flag");
println!(" lesbian lesbian pride flag");
println!(" multigender multigender pride flag");
println!(" nb, nonbinary nonbinary pride flag");
println!(" pan, pansexual pansexual pride flag");
println!(" pride, rainbow six-color rainbow flag");
// println!(" progress progress arrow flag");
println!(" trans, transgender transgender pride flag");
}