Compare commits

...

14 commits

4 changed files with 199 additions and 58 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "pride"
version = "0.2.3"
version = "0.3.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

168
src/help.rs Normal file
View file

@ -0,0 +1,168 @@
//! help and list text
use std::process::exit;
use crate::VERSION;
/// displays the program's help text
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 ");
}
/// shows a list of all flags
pub fn list_text() {
println!("pride v{VERSION}
flag list:
agender agender pride flag
aromantic aromantic pride flag
aroace aromantic-asexual pride flag
asexual asexual pride flag
bigender bigender pride flag
bisexual bisexual pride flag
demiboy demiboy pride flag
demigender demigender pride flag
demigirl demigirl pride flag
demiromantic demiromantic pride flag
demisexual demisexual pride flag
gay 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
nonbinary nonbinary pride flag
pansexual pansexual pride flag
rainbow six-color rainbow flag
progress progress arrow rainbow flag
transgender transgender pride flag");
}
/// handle help details by 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
progress The 2018 Progess rainbow pride flag designed by Daniel Quasar");
},
"progress"
=> { println!("Daniel Quasar's 2018 Progress rainbow pride flag.\n\nnames:\n 'progress'"); }
"transgender" | "trans"
=> {
println!("The transgender pride flag designed by Monica Helms in 1999.
names:
'transgender', 'trans'");
},
// alphabetical below this point
"aromantic" | "aro"
=> { println!("The aromantic pride flag.\n\nnames:\n 'aromantic', 'aro'"); }
"asexual" | "ace"
=> { println!("The asexual pride flag.\n\nnames:\n 'asexual', 'ace'"); }
"aroace" | "aromantic-asexual"
=> {
println!("The aromantic-asexual pride flag designed by aroaesflags on tumblr.
names:
'aroace', 'aromantic-asexual'
variants:
halves The side-by-side aromantic and asexual aroace flag
side-by-side
sbs
notes:
Side-by-side flag currently only displays in terminals 20 lines or taller.");
},
"bisexual" | "bi"
=> {
println!("The bisexual flag designed by Michael Page in 1998.
names:
'bisexual', 'bi'");
},
"gay" | "mlm"
=> {
println!("The 7-stripe gay men pride flag designed by @gayflagblog on tumblr in 2019.
names:
'gay', 'mlm'");
},
"gender-nonconforming" | "gendernonconforming" | "gnc"
=> { println!("The gender-nonconforming pride flag.\n\nnames:\n 'gender-nonconforming', 'gendernonconforming', 'gnc'"); },
"lesbian"
=> {
println!("The 5-stripe lesbian flag designed by Emily Gwen in 2018.
names:
'lesbian'
variants:
7-color 7-stripe flag, also designed in 2018 by Emily Gwen");
},
"nonbinary" | "nb"
=> {
println!("The nonbinary pride flag designed by Kyle Rowan in 2014.
names:
'nonbinary', 'nb'");
},
"pansexual" | "pan"
=> {
println!("The pansexual pride flag designed by Jasper V around 2010
names:
'pansexual', 'pan'");
},
_
=> {
println!("pride: no help found for {flag}!\n");
help_text();
exit(1);
}
}
}

View file

@ -11,6 +11,7 @@ mod color;
mod complex;
mod draw;
mod flag;
mod help;
mod util;
mod variant;
@ -24,18 +25,20 @@ 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;
}
// handle version flag
if args.contains("--version") {
if args.contains(["-v", "--version"]) {
println!("pride v{VERSION}");
return;
}
@ -133,7 +136,14 @@ fn main() {
// => complex::intersex(),
Some("lesbian")
=> flag::lesbian(),
=> {
match variant.as_deref() {
Some("7-color")
=> variant::lesbian_7(),
_
=> flag::lesbian()
}
}
Some("multisexual" | "m-spec" | "mspec")
=> flag::multisexual(),
@ -147,8 +157,8 @@ fn main() {
Some("pansexual" | "pan")
=> flag::pansexual(),
Some("polyamory" | "polyamorous" | "poly")
=> complex::polyamory(small),
// Some("polyamory" | "polyamorous" | "poly")
// => complex::polyamory(small),
Some("polysexual")
=> flag::polysexual(),
@ -156,7 +166,8 @@ fn main() {
Some("transgender" | "trans")
=> flag::transgender(),
_ => { help_text(); exit(1) }
_ => { help::help_text(); exit(1) }
};
// draw flag
@ -164,53 +175,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!(" aroace aromantic/asexual pride flag");
println!(" bigender bigender pride flag");
println!(" bi, bisexual bisexual pride flag");
println!(" demiromantic demiromantic pride flag");
println!(" demisexual demisexual pride flag");
// println!(" disability disability pride flag");
println!(" gay, mlm gay men pride flag");
println!(" genderfluid genderfluid pride flag");
println!(" gender-nonconforming gender nonconforming pride flag");
println!(" genderqueer genderqueer pride flag");
println!(" gendervoid gendervoid pride flag");
// println!(" intersex intersex pride flag");
println!(" lesbian lesbian pride flag");
println!(" multisexual multisexual pride flag");
println!(" multigender multigender pride flag");
println!(" nb, nonbinary nonbinary pride flag");
println!(" pan, pansexual pansexual pride flag");
println!(" polyamory polyamorous pride flag");
println!(" polysexual polysexual pride flag");
println!(" pride, rainbow six-color rainbow flag");
println!(" progress progress arrow flag");
println!(" trans, transgender transgender pride flag");
}

View file

@ -35,3 +35,15 @@ pub fn philadelphia() -> Flag {
Flag::Stripes(colors)
}
pub fn lesbian_7() -> Flag {
let orange1 = rgb(0xD52D00); // gender non-conformity
let orange2 = rgb(0xEF7627); // independence
let orange3 = rgb(0xFF9A56); // community
// white // unique relationships with womanhood
let pink1 = rgb(0xD162A4); // serenity and peace
let pink2 = rgb(0xB55690); // love and sex
let pink3 = rgb(0xA30262); // femininity
Flag::Stripes(vec![orange1, orange2, orange3, WHITE, pink1, pink2, pink3])
}