mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
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:
parent
b04c611058
commit
a2e5251796
1 changed files with 7 additions and 7 deletions
|
@ -350,13 +350,9 @@ Options parse_cmdline(int argc, char** argv)
|
||||||
};
|
};
|
||||||
|
|
||||||
char opts[256];
|
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));
|
sizeof(opts));
|
||||||
|
|
||||||
#ifdef USE_PERFTOOLS_DEBUG
|
|
||||||
strncat(opts, "mM", 2);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int op;
|
int op;
|
||||||
int long_optsind;
|
int long_optsind;
|
||||||
opterr = 0;
|
opterr = 0;
|
||||||
|
@ -444,15 +440,19 @@ Options parse_cmdline(int argc, char** argv)
|
||||||
case 'w':
|
case 'w':
|
||||||
rval.pcap_output_file = optarg;
|
rval.pcap_output_file = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
case 'B':
|
case 'B':
|
||||||
rval.debug_log_streams = optarg;
|
rval.debug_log_streams = optarg;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case 'C':
|
case 'C':
|
||||||
rval.ignore_checksums = true;
|
rval.ignore_checksums = true;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
rval.deterministic_mode = true;
|
rval.deterministic_mode = true;
|
||||||
break;
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
rval.pseudo_realtime = 1.0;
|
rval.pseudo_realtime = 1.0;
|
||||||
if ( optarg )
|
if ( optarg )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue