More getopt_long(), for --help and --version.

Change-Id: Ia02d7b1fbeaa8e581e85ad8b87afabd576515434
Reviewed-on: https://code.wireshark.org/review/2792
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-07-03 00:28:24 -07:00
parent 8afe331369
commit 5889d4b435
1 changed files with 6 additions and 1 deletions

View File

@ -752,6 +752,11 @@ main(int argc, char *argv[])
GString *runtime_info_str;
char *init_progfile_dir_error;
int opt;
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
gboolean arg_error = FALSE;
char *gpf_path, *pf_path;
@ -1060,7 +1065,7 @@ main(int argc, char *argv[])
output_fields = output_fields_new();
/* Now get our args */
while ((opt = getopt(argc, argv, optstring)) != -1) {
while ((opt = getopt_long(argc, argv, optstring, long_options, NULL)) != -1) {
switch (opt) {
case '2': /* Perform two pass analysis */
perform_two_pass_analysis = TRUE;