use belilo::process_images;
use clap::Parser;
use std::path::PathBuf;
use std::process;
#[derive(Parser)]
#[command(
version,
about = "A command-line tool for whitening images.",
long_about = "Belilo, which translates to 'whitewasher' in Russian, is a useful tool created with ❤️ using Rust. It quickly whitens images, providing a clean, uniform appearance. It's fast, efficient, and precise.",
override_usage = "belilo <input_paths>... [options]"
)]
struct Cli {
#[arg(value_name = "input_paths", required = true)]
input_paths: Vec<PathBuf>,
#[arg(short, long = "override")]
override_flag: bool,
}
fn main() {
let cli = Cli::parse();
let mut has_errors = false;
for path in &cli.input_paths {
if let Err(error) = process_images(path, cli.override_flag) {
eprintln!("{}", error);
has_errors = true;
}
}
if has_errors {
process::exit(1);
}
}