From 6c5e16185dfd4c9e955618f56ac8827ad7eda9e7 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Thu, 1 Aug 2013 20:57:47 +0000 Subject: add --capture-comment to tshark make sure that getopt() does not permute tshark's argv[] array svn path=/trunk/; revision=51089 --- capture_opts.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'capture_opts.h') diff --git a/capture_opts.h b/capture_opts.h index a0fdbda5c7..cd98b56f7b 100644 --- a/capture_opts.h +++ b/capture_opts.h @@ -42,7 +42,15 @@ extern "C" { #endif /* __cplusplus */ -#define LONGOPT_NUM_CAP_COMMENT 0 +/* Attention: + for tshark, we're using a leading - in the optstring to prevent getopt() + from permuting the argv[] entries, in this case, unknown argv[] entries + will be returned as parameters to a dummy-option 1 + in short: we must not use 1 here */ + +/* this does not clash with tshark's -2 option which returns '2' */ +#define LONGOPT_NUM_CAP_COMMENT 2 + #ifdef HAVE_PCAP_REMOTE /* Type of capture source */ -- cgit v1.2.1