use std::collections::HashMap;

/// Environment variable utility class
pub struct EnvUtil;

impl EnvUtil {

    pub fn get(key: &str) -> Option<String> {
        std::env::var(key).ok()
    }

    pub fn all() -> HashMap<String, String>{
        let mut map = ::std::collections::HashMap::new();
        // 获取所有环境变量的迭代器
        for (key, value) in std::env::vars() {
            println!("{}: {}", key, value);
            map.insert(key, value);
        }
        map
    }
    
}