diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-07-03 00:28:24 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-07-03 07:28:50 +0000 |
commit | 5889d4b435d8a0063cd272c08f417ce9c6fa1a75 (patch) | |
tree | fc772fb8157b70f835a737385fb34daeed2f45b0 /tfshark.c | |
parent | 8afe3313697e4e5adcb5eebc9bd31b375dee92b0 (diff) |
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>
Diffstat (limited to 'tfshark.c')
-rw-r--r-- | tfshark.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; |