use clap::Parser; use self::{cli::Args, config_file::Configs}; mod cli; mod config_file; /// this struct may hold all configuration pub struct Config { pub startup_msg: bool, } impl Config { pub fn read() -> Self { let args = Args::parse(); let cfg = Configs::read(args.config_file); Self { // this is negated because to an outward api, the negative is more intuitive, // while in the source the other way around is more intuitive startup_msg: !(args.no_startup_message || cfg.no_startup_message), } } }