diff --git a/src/meta_plugin/binary.rs b/src/meta_plugin/binary.rs index 3d0365d..1666455 100644 --- a/src/meta_plugin/binary.rs +++ b/src/meta_plugin/binary.rs @@ -153,12 +153,4 @@ impl MetaPlugin for BinaryMetaPlugin { self.base.options_mut() } - fn configure_options(&mut self, options: &std::collections::HashMap) -> anyhow::Result<()> { - if let Some(max_buffer_size) = options.get("max_buffer_size") { - if let Some(size) = max_buffer_size.as_u64() { - self.max_buffer_size = size as usize; - } - } - Ok(()) - } } diff --git a/src/meta_plugin/cwd.rs b/src/meta_plugin/cwd.rs index 1d368c1..12e65f3 100644 --- a/src/meta_plugin/cwd.rs +++ b/src/meta_plugin/cwd.rs @@ -118,9 +118,6 @@ impl MetaPlugin for CwdMetaPlugin { vec!["cwd".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - std::collections::HashMap::new() - } fn options(&self) -> &std::collections::HashMap { self.base.options() diff --git a/src/meta_plugin/digest.rs b/src/meta_plugin/digest.rs index 14ceed3..5ada6ab 100644 --- a/src/meta_plugin/digest.rs +++ b/src/meta_plugin/digest.rs @@ -222,11 +222,6 @@ impl MetaPlugin for DigestMetaPlugin { ] } - fn default_options(&self) -> std::collections::HashMap { - let mut options = std::collections::HashMap::new(); - options.insert("method".to_string(), serde_yaml::Value::String("sha256".to_string())); - options - } fn options(&self) -> &std::collections::HashMap { &self.options diff --git a/src/meta_plugin/hostname.rs b/src/meta_plugin/hostname.rs index 125319a..827a7cf 100644 --- a/src/meta_plugin/hostname.rs +++ b/src/meta_plugin/hostname.rs @@ -220,11 +220,6 @@ impl MetaPlugin for HostnameMetaPlugin { vec!["hostname".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - let mut options = std::collections::HashMap::new(); - options.insert("full".to_string(), serde_yaml::Value::Bool(true)); - options - } fn options(&self) -> &std::collections::HashMap { &self.options @@ -234,10 +229,4 @@ impl MetaPlugin for HostnameMetaPlugin { &mut self.options } - fn configure_options(&mut self, options: &std::collections::HashMap) -> anyhow::Result<()> { - for (key, value) in options { - self.options.insert(key.clone(), value.clone()); - } - Ok(()) - } } diff --git a/src/meta_plugin/keep_pid.rs b/src/meta_plugin/keep_pid.rs index 395a938..e5f2e26 100644 --- a/src/meta_plugin/keep_pid.rs +++ b/src/meta_plugin/keep_pid.rs @@ -135,9 +135,6 @@ impl MetaPlugin for KeepPidMetaPlugin { vec!["keep_pid".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - std::collections::HashMap::new() - } fn options(&self) -> &std::collections::HashMap { &self.options diff --git a/src/meta_plugin/magic.rs b/src/meta_plugin/magic.rs index 4100613..f86fb3b 100644 --- a/src/meta_plugin/magic.rs +++ b/src/meta_plugin/magic.rs @@ -209,14 +209,6 @@ impl MetaPlugin for MagicFileMetaPlugin { "magic_file".to_string() } - fn configure_options(&mut self, options: &std::collections::HashMap) -> anyhow::Result<()> { - if let Some(max_buffer_size) = options.get("max_buffer_size") { - if let Some(size) = max_buffer_size.as_u64() { - self.max_buffer_size = size as usize; - } - } - Ok(()) - } fn outputs(&self) -> &std::collections::HashMap { self.base.outputs() @@ -230,11 +222,6 @@ impl MetaPlugin for MagicFileMetaPlugin { vec!["mime_type".to_string(), "mime_encoding".to_string(), "file_type".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - let mut options = std::collections::HashMap::new(); - options.insert("max_buffer_size".to_string(), serde_yaml::Value::Number(serde_yaml::Number::from(PIPESIZE as i64))); - options - } fn options(&self) -> &std::collections::HashMap { self.base.options() diff --git a/src/meta_plugin/mod.rs b/src/meta_plugin/mod.rs index 37d38a5..e23df99 100644 --- a/src/meta_plugin/mod.rs +++ b/src/meta_plugin/mod.rs @@ -253,12 +253,6 @@ pub trait MetaPlugin where Self: 'static { std::collections::HashMap::new() } - // Configure plugin with options (excluding outputs) - fn configure_options(&mut self, _options: &std::collections::HashMap) -> anyhow::Result<()> { - // Default implementation does nothing - plugins can override this - Ok(()) - } - // Configure plugin outputs mapping fn configure_outputs(&mut self, outputs: &std::collections::HashMap) -> anyhow::Result<()> { for (key, value) in outputs { @@ -267,13 +261,6 @@ pub trait MetaPlugin where Self: 'static { Ok(()) } - // Configure both options and outputs - fn configure(&mut self, options: &std::collections::HashMap, outputs: &std::collections::HashMap) -> anyhow::Result<()> { - self.configure_options(options)?; - self.configure_outputs(outputs)?; - Ok(()) - } - // Method to downcast to concrete type (for checking finalization state) fn as_any_mut(&mut self) -> &mut dyn std::any::Any where Self: Sized { self diff --git a/src/meta_plugin/program.rs b/src/meta_plugin/program.rs index e6c220f..91c6249 100644 --- a/src/meta_plugin/program.rs +++ b/src/meta_plugin/program.rs @@ -216,9 +216,6 @@ impl MetaPlugin for MetaPluginProgram { vec![self.meta_name.clone()] } - fn default_options(&self) -> std::collections::HashMap { - std::collections::HashMap::new() - } fn options(&self) -> &std::collections::HashMap { &self.options diff --git a/src/meta_plugin/read_rate.rs b/src/meta_plugin/read_rate.rs index 6bf301f..4b8fc97 100644 --- a/src/meta_plugin/read_rate.rs +++ b/src/meta_plugin/read_rate.rs @@ -134,9 +134,6 @@ impl MetaPlugin for ReadRateMetaPlugin { vec!["read_rate".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - std::collections::HashMap::new() - } fn options(&self) -> &std::collections::HashMap { &self.options diff --git a/src/meta_plugin/read_time.rs b/src/meta_plugin/read_time.rs index c5da7be..a79fb46 100644 --- a/src/meta_plugin/read_time.rs +++ b/src/meta_plugin/read_time.rs @@ -127,9 +127,6 @@ impl MetaPlugin for ReadTimeMetaPlugin { vec!["read_time".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - std::collections::HashMap::new() - } fn options(&self) -> &std::collections::HashMap { &self.options diff --git a/src/meta_plugin/shell.rs b/src/meta_plugin/shell.rs index 67678dd..1f65df3 100644 --- a/src/meta_plugin/shell.rs +++ b/src/meta_plugin/shell.rs @@ -138,9 +138,6 @@ impl MetaPlugin for ShellMetaPlugin { vec!["shell".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - std::collections::HashMap::new() - } fn options(&self) -> &std::collections::HashMap { &self.options diff --git a/src/meta_plugin/shell_pid.rs b/src/meta_plugin/shell_pid.rs index f5f8bcf..4ca7aee 100644 --- a/src/meta_plugin/shell_pid.rs +++ b/src/meta_plugin/shell_pid.rs @@ -139,9 +139,6 @@ impl MetaPlugin for ShellPidMetaPlugin { vec!["shell_pid".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - std::collections::HashMap::new() - } fn options(&self) -> &std::collections::HashMap { &self.options diff --git a/src/meta_plugin/text.rs b/src/meta_plugin/text.rs index 3b91dc0..4144e05 100644 --- a/src/meta_plugin/text.rs +++ b/src/meta_plugin/text.rs @@ -521,44 +521,4 @@ impl MetaPlugin for TextMetaPlugin { self.base.options_mut() } - fn configure_options(&mut self, options: &std::collections::HashMap) -> anyhow::Result<()> { - log::debug!("TEXT: Configuring options: {:?}", options); - if let Some(text_detect_size) = options.get("text_detect_size") { - if let Some(size) = text_detect_size.as_u64() { - self.max_buffer_size = size as usize; - } - } - // Handle the old option name for backward compatibility - else if let Some(max_buffer_size) = options.get("max_buffer_size") { - if let Some(size) = max_buffer_size.as_u64() { - self.max_buffer_size = size as usize; - } - } - - // Update tracking options - use default values if not present in options - self.track_word_count = options.get("text_word_count") - .and_then(|v| v.as_bool()) - .unwrap_or(true); - self.track_line_count = options.get("text_line_count") - .and_then(|v| v.as_bool()) - .unwrap_or(true); - - // For line length tracking, check if any of the line length options are enabled - let track_line_max = options.get("text_line_max_len") - .and_then(|v| v.as_bool()) - .unwrap_or(true); - let track_line_mean = options.get("text_line_mean_len") - .and_then(|v| v.as_bool()) - .unwrap_or(true); - let track_line_median = options.get("text_line_median_len") - .and_then(|v| v.as_bool()) - .unwrap_or(true); - - self.track_line_lengths = track_line_max || track_line_mean || track_line_median; - if self.track_line_lengths && self.line_lengths.is_none() { - self.line_lengths = Some(Vec::new()); - } - - Ok(()) - } } diff --git a/src/meta_plugin/user.rs b/src/meta_plugin/user.rs index 49d0aaa..e6477f6 100644 --- a/src/meta_plugin/user.rs +++ b/src/meta_plugin/user.rs @@ -90,9 +90,6 @@ impl MetaPlugin for UserMetaPlugin { vec!["user_uid".to_string(), "user_gid".to_string(), "user_name".to_string(), "user_group".to_string()] } - fn default_options(&self) -> std::collections::HashMap { - std::collections::HashMap::new() - } fn options(&self) -> &std::collections::HashMap { self.base.options()