use std::path::PathBuf;
#[derive(Clone)]
pub struct Config {
pub file: PathBuf,
pub suffix1: String,
pub suffix2: String,
pub buffer: u32,
pub rm: bool,
pub quiet: bool,
}
impl Config {
pub fn new(file: &str) -> Self {
Self {
file: PathBuf::from(file),
..Config::default()
}
}
pub fn new_with_suffixes(file: &str, suffix1: &str, suffix2: &str) -> Self {
Self {
file: PathBuf::from(file),
suffix1: suffix1.to_string(),
suffix2: suffix2.to_string(),
..Config::default()
}
}
fn default() -> Self {
Self {
file: PathBuf::new(),
suffix1: "otp.0".to_string(),
suffix2: "otp.1".to_string(),
buffer: 1048576,
rm: false,
quiet: true,
}
}
}