parenv 0.1.10

Environment variable parser with a clap style derive macro and elm style error reporting.
Documentation
pub struct EnvGuard {
    vars: Vec<String>,
}

impl EnvGuard {
    pub fn set(name: &str, value: &str) -> Self {
        std::env::set_var(name, value);
        Self {
            vars: vec![name.to_string()],
        }
    }

    pub fn and_set(mut self, name: &str, value: &str) -> Self {
        std::env::set_var(name, value);
        self.vars.push(name.to_string());
        self
    }
}

impl Drop for EnvGuard {
    fn drop(&mut self) {
        for var in &self.vars {
            std::env::remove_var(var);
        }
    }
}