diff --git a/src/bin/installer.rs b/src/bin/installer.rs index bd87130d49727c5ae8cc99b85205295e74cf9552..c04d7cc294b989c2fe4300204dad126d08b4fe0a 100644 --- a/src/bin/installer.rs +++ b/src/bin/installer.rs @@ -18,6 +18,7 @@ fn main() { let mut parser = ArgParser::new(4) .add_opt("b", "cookbook") .add_opt("c", "config") + .add_flag(&["filesystem-size"]) .add_flag(&["r", "repo-binary"]) .add_flag(&["l", "list-packages"]) .add_flag(&["live"]); @@ -51,7 +52,9 @@ fn main() { config.general.repo_binary = Some(true); } - if parser.found("list-packages") { + if parser.found("filesystem-size") { + println!("{}", config.general.filesystem_size.unwrap_or(0)); + } else if parser.found("list-packages") { // List the packages that should be fetched or built by the cookbook for (packagename, package) in &config.packages { match package { diff --git a/src/config/general.rs b/src/config/general.rs index b02448a5542824f163171489fc3f44caff474d0d..3e26d3772ed3050e8e8cc0fb90e83c2ff9e17026 100644 --- a/src/config/general.rs +++ b/src/config/general.rs @@ -3,6 +3,7 @@ pub struct GeneralConfig { pub prompt: Option<bool>, // Allow config to specify cookbook recipe or binary package as default pub repo_binary: Option<bool>, + pub filesystem_size: Option<u32>, //MiB pub efi_partition_size: Option<u32>, //MiB } @@ -10,6 +11,7 @@ impl GeneralConfig { pub(super) fn merge(&mut self, other: GeneralConfig) { self.prompt = other.prompt.or(self.prompt); self.repo_binary = other.repo_binary.or(self.repo_binary); + self.filesystem_size = other.filesystem_size.or(self.filesystem_size); self.efi_partition_size = other.efi_partition_size.or(self.efi_partition_size); } }