diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2019-12-15 14:15:34 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2019-12-15 20:02:09 +0000 |
commit | d90a22c1cc3a6eaf739e9f4b40ea276dbc916d62 (patch) | |
tree | d973eed229ea71f354669d448f20dc5158ba2c12 /editcap.c | |
parent | 1cd1e36a05bd0f14b38ce3978e3313d57b3b25d4 (diff) |
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 <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'editcap.c')
-rw-r--r-- | editcap.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1017,11 +1017,13 @@ main(int argc, char *argv[]) int i, j, read_err, write_err; gchar *read_err_info, *write_err_info; int opt; -#define LONGOPT_NO_VLAN 0x8100 -#define LONGOPT_SKIP_RADIOTAP_HEADER 0x8101 -#define LONGOPT_SEED 0x8102 -#define LONGOPT_INJECT_SECRETS 0x8103 -#define LONGOPT_DISCARD_ALL_SECRETS 0x8104 + +#define LONGOPT_NO_VLAN LONGOPT_BASE_APPLICATION+1 +#define LONGOPT_SKIP_RADIOTAP_HEADER LONGOPT_BASE_APPLICATION+2 +#define LONGOPT_SEED LONGOPT_BASE_APPLICATION+3 +#define LONGOPT_INJECT_SECRETS LONGOPT_BASE_APPLICATION+4 +#define LONGOPT_DISCARD_ALL_SECRETS LONGOPT_BASE_APPLICATION+5 + static const struct option long_options[] = { {"novlan", no_argument, NULL, LONGOPT_NO_VLAN}, {"skip-radiotap-header", no_argument, NULL, LONGOPT_SKIP_RADIOTAP_HEADER}, |