aboutsummaryrefslogtreecommitdiffstats
path: root/ui
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 /ui
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 'ui')
-rw-r--r--ui/qt/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index 871d0e92a0..c91937e846 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -516,8 +516,10 @@ int main(int argc, char *argv[])
#endif
#define OPTSTRING "a:b:" OPTSTRING_B "c:C:Df:g:Hhi:" OPTSTRING_I "jJ:kK:lLm:nN:o:P:pQr:R:Ss:t:u:vw:X:y:z:"
- struct option long_options[] = {
- {(char *)"read-file", required_argument, NULL, (int)'r' },
+ static const struct option long_options[] = {
+ {(char *)"help", no_argument, NULL, 'h'},
+ {(char *)"read-file", required_argument, NULL, 'r' },
+ {(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
static const char optstring[] = OPTSTRING;