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 prompt_prefix: Option<String>,
9 pub banner: Option<String>,
10 pub welcome: Option<Vec<String>>,
11 pub goodbye: Option<Vec<String>>,
12 pub line_delay: Option<u64>,
13}
14
15impl CliConfig {
16 pub fn load(path: &str) -> Self {
17 let data = fs::read_to_string(path).expect("Failed to read config JSON");
18 serde_json::from_str(&data).expect("Invalid config JSON format")
19 }
20}