errors now write to stderr instead of stdout

This commit is contained in:
Valerie Wolfe 2024-07-12 10:49:46 -04:00
parent 6a9bbe664a
commit 05e1bd48e0

View file

@ -1,24 +1,24 @@
use std::process::exit;
pub fn unmatched_flag(target: String) {
println!("pride: no flag {target}");
eprintln!("pride: no flag {target}");
exit(1);
}
pub fn size_missing() {
println!("pride: size flag requires a value");
eprintln!("pride: size flag requires a value");
exit(2);
}
pub fn size_error(value: &str) {
println!("pride: size '{value}' is invalid");
eprintln!("pride: size '{value}' is invalid");
exit(2);
}
pub fn too_small(width: u16, height: u16) {
println!("pride: this flag must be bigger than {width}x{height}");
eprintln!("pride: this flag must be bigger than {width}x{height}");
exit(3);
}