diff --git a/src/main.rs b/src/main.rs index a35bc84..3c904bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,7 +30,14 @@ struct Args { keywords: Vec, } -static ARGS: Lazy = Lazy::new(Args::parse); +static ARGS: Lazy = Lazy::new(|| { + let mut args = Args::parse(); + if let Some(keywords_file) = args.keywords_file.take() { + let content = std::fs::read_to_string(keywords_file).expect("failed to read keywords file"); + args.keywords.extend(content.lines().map(|s| s.to_string())); + } + args +}); thread_local! { static ANALYZER: OnceCell = const { OnceCell::new() }; }