Compare commits
No commits in common. "3e86e4f05328497e59d98d808bef071b2984f73f" and "bbbfc924dea036e31801adc4c3de01981999e751" have entirely different histories.
3e86e4f053
...
bbbfc924de
2 changed files with 7 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pride"
|
name = "pride"
|
||||||
version = "0.1.2"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
20
src/main.rs
20
src/main.rs
|
@ -8,30 +8,21 @@ mod flag;
|
||||||
|
|
||||||
use crate::color::Colors;
|
use crate::color::Colors;
|
||||||
|
|
||||||
static VERSION: &str = env!("CARGO_PKG_VERSION");
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut args = Arguments::from_env();
|
let mut args = Arguments::from_env();
|
||||||
|
|
||||||
// handle help flag
|
let help = args.contains(["-h", "--help"]);
|
||||||
if args.contains(["-h", "--help"]) {
|
if help {
|
||||||
help_text();
|
help_text();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle list flag
|
let list = args.contains(["-l", "--list"]);
|
||||||
if args.contains(["-l", "--list"]) {
|
if list {
|
||||||
list_text();
|
list_text();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle version flag
|
|
||||||
if args.contains("--version") {
|
|
||||||
println!("pride v{VERSION}");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get small flag
|
|
||||||
let small = args.contains(["-s", "--small"]);
|
let small = args.contains(["-s", "--small"]);
|
||||||
|
|
||||||
let subcommand = args.subcommand().unwrap();
|
let subcommand = args.subcommand().unwrap();
|
||||||
|
@ -89,7 +80,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn help_text() {
|
fn help_text() {
|
||||||
println!("pride v{VERSION}");
|
println!("pride v{}", env!("CARGO_PKG_VERSION"));
|
||||||
println!("Valerie Wolfe <sleeplessval@gmail.com>");
|
println!("Valerie Wolfe <sleeplessval@gmail.com>");
|
||||||
println!("Show pride flags in the terminal.\n");
|
println!("Show pride flags in the terminal.\n");
|
||||||
|
|
||||||
|
@ -100,7 +91,6 @@ fn help_text() {
|
||||||
|
|
||||||
println!("flags:");
|
println!("flags:");
|
||||||
println!(" -h, --help Shows this help text");
|
println!(" -h, --help Shows this help text");
|
||||||
println!(" --version Show version information");
|
|
||||||
println!(" -l, --list Prints a list of printable flags");
|
println!(" -l, --list Prints a list of printable flags");
|
||||||
println!(" -s, --small Prints a small version without holding");
|
println!(" -s, --small Prints a small version without holding");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue