diff --git a/Cargo.lock b/Cargo.lock index fe3007b..78ed336 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2457,7 +2457,7 @@ dependencies = [ [[package]] name = "objdiff" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "byteorder", diff --git a/Cargo.toml b/Cargo.toml index a5cc068..c658753 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "objdiff" -version = "0.4.3" +version = "0.4.4" edition = "2021" rust-version = "1.65" authors = ["Luke Street "] diff --git a/src/app.rs b/src/app.rs index 043cfbd..fc36cdc 100644 --- a/src/app.rs +++ b/src/app.rs @@ -54,23 +54,38 @@ pub struct ObjectConfig { #[inline] fn bool_true() -> bool { true } +#[inline] +fn default_watch_patterns() -> Vec { + DEFAULT_WATCH_PATTERNS.iter().map(|s| Glob::new(s).unwrap()).collect() +} + #[derive(Clone, serde::Deserialize, serde::Serialize)] pub struct AppConfig { // TODO: https://github.com/ron-rs/ron/pull/455 // #[serde(flatten)] // pub version: AppConfigVersion, pub version: u32, + #[serde(default)] pub custom_make: Option, + #[serde(default)] pub selected_wsl_distro: Option, + #[serde(default)] pub project_dir: Option, + #[serde(default)] pub target_obj_dir: Option, + #[serde(default)] pub base_obj_dir: Option, + #[serde(default)] pub selected_obj: Option, + #[serde(default)] pub build_target: bool, #[serde(default = "bool_true")] pub rebuild_on_changes: bool, + #[serde(default)] pub auto_update_check: bool, + #[serde(default = "default_watch_patterns")] pub watch_patterns: Vec, + #[serde(default)] pub recent_projects: Vec, #[serde(skip)]