aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-06-20 12:18:48 -0700
committerGuy Harris <guy@alum.mit.edu>2014-06-20 19:19:47 +0000
commit312ed10900df878ef8476febe72c8f1308aba106 (patch)
treec4a73afa3bd05891cad18cbde65b64d2c1ee2330 /tshark.c
parent6808afd0172cc1507f19ef1533f500fac4b0dce2 (diff)
Add --help and --version long options.
Also, make the convention for long-only options be that their case-statement values start at 128, so they avoid colliding with any ASCII code points, including control characters. Make the tables of long options "static const" while we're at it, and get rid of unnecessary casts. Change-Id: I55702a85e9bc078b1cd0f2803ebb68a710405bab Reviewed-on: https://code.wireshark.org/review/2491 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tshark.c b/tshark.c
index 539792cd74..c50d28a353 100644
--- a/tshark.c
+++ b/tshark.c
@@ -922,8 +922,10 @@ main(int argc, char *argv[])
GString *runtime_info_str;
char *init_progfile_dir_error;
int opt;
- struct option long_options[] = {
+ static const struct option long_options[] = {
{(char *)"capture-comment", required_argument, NULL, LONGOPT_NUM_CAP_COMMENT },
+ {(char *)"help", no_argument, NULL, 'h'},
+ {(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
gboolean arg_error = FALSE;