modcli/config.rs
1use serde::Deserialize;
2use std::fs;
3
4#[derive(Debug, Deserialize)]
5pub struct CliConfig {
6 pub theme: Option<String>,
7 pub strict_args: Option<bool>,
8 pub banner: Option<String>,
9}
10
11impl CliConfig {
12 pub fn load(path: &str) -> Self {
13 let data = fs::read_to_string(path).expect("Failed to read config JSON");
14 serde_json::from_str(&data).expect("Invalid config JSON format")
15 }
16}