mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Allow --parse-only to work with --usage-issues flag
Use of --parse-only would previously exit before --usage-issues had a chance to analyze scripts and report any discovered issues and it can be useful to combine both flags for checking scripts for mistakes without actually executing any code. This also improves the behavior of --parse-only in combination with reporting problems in signature files (previously, it exited before even reading them).
This commit is contained in:
parent
91dc6fbbb0
commit
ac0b09d1a4
6 changed files with 34 additions and 6 deletions
|
@ -680,12 +680,6 @@ SetupResult setup(int argc, char** argv, Options* zopts)
|
|||
file_mgr->InitPostScript();
|
||||
dns_mgr->InitPostScript();
|
||||
|
||||
if ( options.parse_only )
|
||||
{
|
||||
int rc = (reporter->Errors() > 0 ? 1 : 0);
|
||||
exit(rc);
|
||||
}
|
||||
|
||||
#ifdef USE_PERFTOOLS_DEBUG
|
||||
}
|
||||
#endif
|
||||
|
@ -764,6 +758,9 @@ 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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue