From d90a22c1cc3a6eaf739e9f4b40ea276dbc916d62 Mon Sep 17 00:00:00 2001 From: Jaap Keuter Date: Sun, 15 Dec 2019 14:15:34 +0100 Subject: Reorganize long option values For long options, without corresponding short options, to be processed they need to be assigned a value, preferably outside of the range of all possible short options. The code in various places tries to stay clear of these low values, but further coordination is missing, easily leading to issues when option processing code gets extended and/or reorganized. This change introduces a single location from where each catagory of command line long option can derive a base value, which should minimize potential option value collisions. Change-Id: Ic8861a347d0050f74002de3aa1fcfb01202866e5 Reviewed-on: https://code.wireshark.org/review/35459 Reviewed-by: Jaap Keuter Petri-Dish: Jaap Keuter Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte --- tshark.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'tshark.c') diff --git a/tshark.c b/tshark.c index bcd180e2e8..7473d3b5a6 100644 --- a/tshark.c +++ b/tshark.c @@ -137,13 +137,10 @@ #define INVALID_CAPTURE 2 #define INIT_FAILED 2 -/* - * values 128..65535 are capture+dissect options, 65536 is used by - * ui/commandline.c, so start tshark-specific options 1000 after this - */ -#define LONGOPT_COLOR (65536+1000) -#define LONGOPT_NO_DUPLICATE_KEYS (65536+1001) -#define LONGOPT_ELASTIC_MAPPING_FILTER (65536+1002) +#define LONGOPT_EXPORT_OBJECTS LONGOPT_BASE_APPLICATION+1 +#define LONGOPT_COLOR LONGOPT_BASE_APPLICATION+2 +#define LONGOPT_NO_DUPLICATE_KEYS LONGOPT_BASE_APPLICATION+3 +#define LONGOPT_ELASTIC_MAPPING_FILTER LONGOPT_BASE_APPLICATION+4 #if 0 #define tshark_debug(...) g_warning(__VA_ARGS__) -- cgit v1.2.1