added terminal check

This commit is contained in:
Valerie Wolfe 2023-08-14 11:51:13 -04:00
parent 2617c19227
commit 02d06b68ef

View file

@ -1,4 +1,7 @@
use std::process::exit;
use std::{
io::{ stdout, IsTerminal },
process::exit
};
use pico_args::Arguments;
@ -35,6 +38,11 @@ fn main() {
return;
}
if !stdout().is_terminal() {
println!("pride: output must be a terminal");
exit(2);
}
// get small flag
let small = args.contains(["-s", "--small"]);