use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
pub(crate) enum CliError {
#[error("i/o error on {path}: {source}")]
Io {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("failed to decode image {path}: {source}")]
Decode {
path: PathBuf,
#[source]
source: image::ImageError,
},
#[error(transparent)]
Codec(#[from] gamut::core::Error),
#[error("unsupported output format: {0} (supported: 'avif', 'webp')")]
UnsupportedOutput(String),
#[error("invalid argument: {0}")]
Usage(String),
}