Minor tweaks to single-character command line option handling

- Use of "-B" now triggers usage output and errors out when Zeek
  wasn't built with debugging support.

- Always keep the perftools options (-m, -M) in the optparse string,
  for consistency with other flags dependent on configuration. We
  still fall through to usage and erroring out as before.

- Minor indentation fix.
This commit is contained in:
Christian Kreibich 2021-06-23 15:50:43 -07:00
parent b04c611058
commit a2e5251796

View file

@ -350,13 +350,9 @@ Options parse_cmdline(int argc, char** argv)
};
char opts[256];
util::safe_strncpy(opts, "B:e:f:G:H:I:i:j::n:O:o:p:r:s:T:t:U:w:X:CDFNPQSWabdhuv",
util::safe_strncpy(opts, "B:e:f:G:H:I:i:j::n:O:o:p:r:s:T:t:U:w:X:CDFMNPQSWabdhmuv",
sizeof(opts));
#ifdef USE_PERFTOOLS_DEBUG
strncat(opts, "mM", 2);
#endif
int op;
int long_optsind;
opterr = 0;
@ -444,15 +440,19 @@ Options parse_cmdline(int argc, char** argv)
case 'w':
rval.pcap_output_file = optarg;
break;
#ifdef DEBUG
case 'B':
rval.debug_log_streams = optarg;
break;
#endif
case 'C':
rval.ignore_checksums = true;
break;
case 'D':
rval.deterministic_mode = true;
break;
rval.deterministic_mode = true;
break;
case 'E':
rval.pseudo_realtime = 1.0;
if ( optarg )