summaryrefslogtreecommitdiff
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-06-20 13:59:45 -0700
committerGuy Harris <guy@alum.mit.edu>2014-06-20 21:00:16 +0000
commit26bbee3fadc68237801e4ed65b87c97b3cdf3156 (patch)
tree9fe9f9e7c11733a34797c1c0694f363d060ed696 /tshark.c
parent312ed10900df878ef8476febe72c8f1308aba106 (diff)
downloadwireshark-26bbee3fadc68237801e4ed65b87c97b3cdf3156.tar.gz
Add some long options for capture short options.
The names match tcpdump trunk's names for the corresponding options. Also have capture_opts.h provide a #define for the part of the short option string that corresponds to the capture short options that all our programs that take capture short options take (those are largely the ones we have in common with tcpdump). Change-Id: Ia209425959c801725850b56a7d63441ee99b5001 Reviewed-on: https://code.wireshark.org/review/2492 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/tshark.c b/tshark.c
index c50d28a353..78104cada9 100644
--- a/tshark.c
+++ b/tshark.c
@@ -926,6 +926,7 @@ main(int argc, char *argv[])
{(char *)"capture-comment", required_argument, NULL, LONGOPT_NUM_CAP_COMMENT },
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
+ LONGOPT_CAPTURE_COMMON,
{0, 0, 0, 0 }
};
gboolean arg_error = FALSE;
@@ -973,31 +974,14 @@ main(int argc, char *argv[])
int optind_initial;
gchar *output_only = NULL;
-#ifdef HAVE_PCAP_REMOTE
-#define OPTSTRING_A "A:"
-#else
-#define OPTSTRING_A ""
-#endif
-#ifdef HAVE_LIBPCAP
-#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
-#define OPTSTRING_B "B:"
-#else
-#define OPTSTRING_B ""
-#endif /* _WIN32 or HAVE_PCAP_CREATE */
-#else /* HAVE_LIBPCAP */
+#ifndef HAVE_LIBPCAP
#define OPTSTRING_B ""
#endif /* HAVE_LIBPCAP */
-#ifdef HAVE_PCAP_CREATE
-#define OPTSTRING_I "I"
-#else
-#define OPTSTRING_I ""
-#endif
-
/* the leading - ensures that getopt() does not permute the argv[] entries
we have to make sure that the first getopt() preserves the content of argv[]
for the subsequent getopt_long() call */
-#define OPTSTRING "-2a:" OPTSTRING_A "b:" OPTSTRING_B "c:C:d:De:E:f:F:gG:hH:i:" OPTSTRING_I "K:lLnN:o:O:pPqQr:R:s:S:t:T:u:vVw:W:xX:y:Y:z:"
+#define OPTSTRING "-2" OPTSTRING_CAPTURE_COMMON "C:d:e:E:F:gG:hH:" "K:lnN:o:O:PqQr:R:S:t:T:u:vVw:W:xX:Y:z:"
static const char optstring[] = OPTSTRING;