added terminal check
This commit is contained in:
parent
2617c19227
commit
02d06b68ef
1 changed files with 9 additions and 1 deletions
10
src/main.rs
10
src/main.rs
|
@ -1,4 +1,7 @@
|
||||||
use std::process::exit;
|
use std::{
|
||||||
|
io::{ stdout, IsTerminal },
|
||||||
|
process::exit
|
||||||
|
};
|
||||||
|
|
||||||
use pico_args::Arguments;
|
use pico_args::Arguments;
|
||||||
|
|
||||||
|
@ -35,6 +38,11 @@ fn main() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !stdout().is_terminal() {
|
||||||
|
println!("pride: output must be a terminal");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
// get small flag
|
// get small flag
|
||||||
let small = args.contains(["-s", "--small"]);
|
let small = args.contains(["-s", "--small"]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue