diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index e168dfd00a..d9211a6ccc 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -783,6 +783,14 @@ SetupResult setup(int argc, char** argv, Options* zopts) } } + if ( options.parse_only ) + { + if ( analysis_options.usage_issues > 0 ) + analyze_scripts(); + + exit(reporter->Errors() != 0); + } + auto init_stmts = stmts ? analyze_global_stmts(stmts) : nullptr; analyze_scripts(); @@ -791,9 +799,6 @@ SetupResult setup(int argc, char** argv, Options* zopts) // This option is report-and-exit. exit(0); - if ( options.parse_only ) - exit(reporter->Errors() != 0); - if ( dns_type != DNS_PRIME ) run_state::detail::init_run(options.interface, options.pcap_file, options.pcap_output_file, options.use_watchdog);