Put cmd-line options in alphabetical order

Sorted cmd-line options in alphabetical order to make it easier to
add or remove options (or even to just check if they're listed
correctly in the source code).
This commit is contained in:
Daniel Thayer 2015-06-18 12:39:46 -05:00
parent 668f3e38ad
commit 6c812bd5d6

View file

@ -179,8 +179,8 @@ void usage()
fprintf(stderr, " -r|--readfile <readfile> | read from given tcpdump file\n"); fprintf(stderr, " -r|--readfile <readfile> | read from given tcpdump file\n");
fprintf(stderr, " -s|--rulefile <rulefile> | read rules from given file\n"); fprintf(stderr, " -s|--rulefile <rulefile> | read rules from given file\n");
fprintf(stderr, " -t|--tracefile <tracefile> | activate execution tracing\n"); fprintf(stderr, " -t|--tracefile <tracefile> | activate execution tracing\n");
fprintf(stderr, " -w|--writefile <writefile> | write to given tcpdump file\n");
fprintf(stderr, " -v|--version | print version and exit\n"); fprintf(stderr, " -v|--version | print version and exit\n");
fprintf(stderr, " -w|--writefile <writefile> | write to given tcpdump file\n");
fprintf(stderr, " -x|--print-state <file.bst> | print contents of state file\n"); fprintf(stderr, " -x|--print-state <file.bst> | print contents of state file\n");
fprintf(stderr, " -z|--analyze <analysis> | run the specified policy file analysis\n"); fprintf(stderr, " -z|--analyze <analysis> | run the specified policy file analysis\n");
#ifdef DEBUG #ifdef DEBUG
@ -547,7 +547,7 @@ int main(int argc, char** argv)
opterr = 0; opterr = 0;
char opts[256]; char opts[256];
safe_strncpy(opts, "B:e:f:I:i:J:K:n:p:R:r:s:T:t:U:w:x:X:z:CFNPSWabdghvQ", safe_strncpy(opts, "B:e:f:I:i:J:K:n:p:R:r:s:T:t:U:w:x:X:z:CFNPQSWabdghv",
sizeof(opts)); sizeof(opts));
#ifdef USE_PERFTOOLS_DEBUG #ifdef USE_PERFTOOLS_DEBUG
@ -582,6 +582,10 @@ int main(int argc, char** argv)
dump_cfg = true; dump_cfg = true;
break; break;
case 'h':
usage();
break;
case 'i': case 'i':
interfaces.append(optarg); interfaces.append(optarg);
break; break;
@ -603,10 +607,19 @@ int main(int argc, char** argv)
g_trace_state.TraceOn(); g_trace_state.TraceOn();
break; break;
case 'v':
fprintf(stderr, "%s version %s\n", prog, bro_version());
exit(0);
break;
case 'w': case 'w':
writefile = optarg; writefile = optarg;
break; break;
case 'x':
bst_file = optarg;
break;
case 'z': case 'z':
if ( streq(optarg, "notice") ) if ( streq(optarg, "notice") )
do_notice_analysis = 1; do_notice_analysis = 1;
@ -617,6 +630,10 @@ int main(int argc, char** argv)
} }
break; break;
case 'B':
debug_streams = optarg;
break;
case 'C': case 'C':
override_ignore_checksums = 1; override_ignore_checksums = 1;
break; break;
@ -688,13 +705,8 @@ int main(int argc, char** argv)
do_watchdog = 1; do_watchdog = 1;
break; break;
case 'h': case 'X':
usage(); broxygen_config = optarg;
break;
case 'v':
fprintf(stderr, "%s version %s\n", prog, bro_version());
exit(0);
break; break;
#ifdef USE_PERFTOOLS_DEBUG #ifdef USE_PERFTOOLS_DEBUG
@ -707,9 +719,6 @@ int main(int argc, char** argv)
break; break;
#endif #endif
case 'x':
bst_file = optarg;
break;
#if 0 // broken #if 0 // broken
case 'X': case 'X':
bst_file = optarg; bst_file = optarg;
@ -717,10 +726,6 @@ int main(int argc, char** argv)
break; break;
#endif #endif
case 'X':
broxygen_config = optarg;
break;
#ifdef USE_IDMEF #ifdef USE_IDMEF
case 'n': case 'n':
fprintf(stderr, "Using IDMEF XML DTD from %s\n", optarg); fprintf(stderr, "Using IDMEF XML DTD from %s\n", optarg);
@ -728,10 +733,6 @@ int main(int argc, char** argv)
break; break;
#endif #endif
case 'B':
debug_streams = optarg;
break;
case 0: case 0:
// This happens for long options that don't have // This happens for long options that don't have
// a short-option equivalent. // a short-option equivalent.