diff --git a/fact/src/config/mod.rs b/fact/src/config/mod.rs index 61ed9886..9922584e 100644 --- a/fact/src/config/mod.rs +++ b/fact/src/config/mod.rs @@ -53,7 +53,7 @@ impl FactConfig { )?; // Once file configuration is handled, apply CLI arguments - let args = FactCli::try_parse()?; + let args = FactCli::parse(); config.update(&args.to_config()); info!("{config:#?}"); diff --git a/fact/src/lib.rs b/fact/src/lib.rs index 21781a8b..bcc1a08a 100644 --- a/fact/src/lib.rs +++ b/fact/src/lib.rs @@ -63,6 +63,9 @@ pub fn log_system_information() { } pub async fn run(config: FactConfig) -> anyhow::Result<()> { + // Log system information as early as possible so we have it + // available in case of a crash + log_system_information(); let (run_tx, run_rx) = watch::channel(true); let (tx, rx) = broadcast::channel(100); diff --git a/fact/src/main.rs b/fact/src/main.rs index 7f1efb81..8b5a1a1f 100644 --- a/fact/src/main.rs +++ b/fact/src/main.rs @@ -3,11 +3,6 @@ use fact::config::FactConfig; #[tokio::main] async fn main() -> anyhow::Result<()> { fact::init_log()?; - - // Log system information as early as possible so we have it - // available in case of a crash - fact::log_system_information(); - let config = FactConfig::new(&[ "/etc/stackrox/fact.yml", "/etc/stackrox/fact.yaml",