use clap::Parser;
use std::process;
#[derive(Parser, Debug)]
#[clap(author = "Victor Nilsson (github.com/vcrn)", version, about = "Simple system resource monitoring CLI tool for Linux systems, with GPU temperature monitoring for Raspberry Pi)", long_about = None)]
pub struct Args {
#[clap(short = 'c', long, default_value = "s")]
color: char,
#[clap(short, long)]
gpu: bool,
#[clap(short = 'd', long, default_value_t = 2)]
delay: usize,
}
fn terminate_with_error(err: anyhow::Error) {
eprintln!("Compability issue. FeO is designed to run on Linux. GPU temperature monitor option only works for Raspberry Pi. Error message: {err}");
process::exit(1);
}
fn main() {
let args = Args::parse();
if let Err(e) = feo::run(args.delay, args.gpu, args.color) {
terminate_with_error(e);
}
}