use std::io;
use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("failed to read `{path}`: {source}")]
Read {
path: PathBuf,
#[source]
source: io::Error,
},
#[error("configuration file `{0}` must have a .toml or .json extension")]
UnsupportedConfigFormat(PathBuf),
#[error("failed to parse {format} configuration `{path}`: {message}")]
ParseConfig {
path: PathBuf,
format: &'static str,
message: String,
},
#[error(transparent)]
Template(#[from] toargv_template::Error),
#[error("failed to execute `{program}`: {source}")]
Execute {
program: String,
#[source]
source: io::Error,
},
#[error("an executable command is required")]
MissingCommand,
#[error("argument cannot be represented in shell syntax: {0:?}")]
Unquotable(String),
}