use std::ffi::{OsStr, OsString};
#[derive(Debug, Default)]
pub struct Env {
cli: Vec<OsString>,
}
impl Env {
pub fn new(cli: Vec<OsString>) -> Self {
Self { cli }
}
pub fn get_cli(&self, position: usize) -> Option<&OsStr> {
self.cli.get(position).map(|x| &**x)
}
pub fn cli_len(&self) -> usize {
self.cli.len()
}
pub fn get_env(&self, name: &OsStr) -> Option<OsString> {
std::env::var_os(name)
}
}