use std::ffi::OsString;

use crate::error::{NetavarkError, NetavarkResult};

pub mod create;
pub mod dhcp_proxy;
pub mod firewall_reload;
pub mod firewalld_reload;
pub mod setup;
pub mod teardown;
pub mod update;
pub mod version;

fn get_config_dir(dir: Option<OsString>, cmd: &str) -> NetavarkResult<OsString> {
    dir.ok_or_else(|| {
        NetavarkError::msg(format!(
            "--config not specified but required for netavark {cmd}"
        ))
    })
}
