Compare commits

..

2 commits

Author SHA1 Message Date
515f6da05c version bump 2023-08-14 11:51:29 -04:00
02d06b68ef added terminal check 2023-08-14 11:51:13 -04:00
2 changed files with 10 additions and 2 deletions

View file

@ -1,6 +1,6 @@
[package] [package]
name = "pride" name = "pride"
version = "0.2.1" version = "0.2.2"
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

View file

@ -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"]);