Allow wslog parameters in all applications
Since wslog command line parameters are no longer removed from argv/argc, applications need to be able to ignore them if they are picky about the options for the application.
This commit is contained in:
parent
6384324bdc
commit
e55955feab
6
dftest.c
6
dftest.c
@ -456,8 +456,14 @@ main(int argc, char **argv)
|
||||
break;
|
||||
case '?':
|
||||
print_usage(EXIT_FAILURE);
|
||||
break;
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
ws_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1907,6 +1907,10 @@ main(int argc, char *argv[])
|
||||
|
||||
case '?': /* Bad options - print usage */
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
switch(ws_optopt) {
|
||||
case'F':
|
||||
list_capture_types(stdout);
|
||||
|
@ -307,6 +307,11 @@ main(int argc, char *argv[])
|
||||
}
|
||||
break;
|
||||
case '?': /* Bad options if GNU getopt */
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
switch(ws_optopt) {
|
||||
case'F':
|
||||
list_capture_types();
|
||||
|
@ -214,6 +214,10 @@ main(int argc, char *argv[])
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
usage(true);
|
||||
ret = WS_EXIT_INVALID_OPTION;
|
||||
goto clean_exit;
|
||||
|
@ -667,8 +667,12 @@ main(int argc, char *argv[])
|
||||
goto clean_exit;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case '?': /* Bad flag - print usage message */
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
print_usage(stderr);
|
||||
ret = WS_EXIT_INVALID_OPTION;
|
||||
goto clean_exit;
|
||||
|
@ -217,6 +217,11 @@ main(int argc, char *argv[])
|
||||
show_version();
|
||||
goto clean_exit;
|
||||
case '?':
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
print_usage(stderr);
|
||||
ret = WS_EXIT_INVALID_OPTION;
|
||||
goto clean_exit;
|
||||
|
@ -344,6 +344,10 @@ sharkd_init(int argc, char **argv)
|
||||
break;
|
||||
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
if (!ws_optopt)
|
||||
fprintf(stderr, "This option isn't supported: %s\n", argv[ws_optind]);
|
||||
fprintf(stderr, "Use sharkd -h for details of supported options\n");
|
||||
|
@ -747,8 +747,12 @@ main(int argc, char *argv[])
|
||||
goto clean_exit;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case '?': /* Bad flag - print usage message */
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
print_usage(stderr);
|
||||
exit_status = WS_EXIT_INVALID_OPTION;
|
||||
goto clean_exit;
|
||||
|
6
tshark.c
6
tshark.c
@ -1935,8 +1935,12 @@ main(int argc, char *argv[])
|
||||
goto clean_exit;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case '?': /* Bad flag - print usage message */
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
switch(ws_optopt) {
|
||||
case 'F':
|
||||
list_capture_types();
|
||||
|
@ -714,8 +714,12 @@ void commandline_other_options(int argc, char *argv[], bool opt_reset)
|
||||
arg_error = true;
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
case '?': /* Bad flag - print usage message */
|
||||
default:
|
||||
/* wslog arguments are okay */
|
||||
if (ws_log_is_wslog_arg(opt))
|
||||
break;
|
||||
|
||||
arg_error = true;
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user