aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal@wireshark.org>2023-06-13 21:49:45 +0200
committerJohn Thacker <johnthacker@gmail.com>2023-06-13 21:49:46 +0000
commit274e67998e84ba12a55b3e9456e500e4c632ac21 (patch)
tree125e8ad320c42aef619f7565adb28bbfcaf1b04d
parentaa54f33700f43be4ec8505308b6dd4e522ee6f87 (diff)
tshark: add support for field alias when specifying a list of fields to display
The ek/pdml/json output will display the new filter name and not the aliased older one
-rw-r--r--tshark.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tshark.c b/tshark.c
index bb3ac545d2..1f3a1ef195 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1344,7 +1344,13 @@ main(int argc, char *argv[])
break;
case 'e':
/* Field entry */
- output_fields_add(output_fields, ws_optarg);
+ {
+ header_field_info *hfi = proto_registrar_get_byalias(ws_optarg);
+ if (hfi)
+ output_fields_add(output_fields, hfi->abbrev);
+ else
+ output_fields_add(output_fields, ws_optarg);
+ }
break;
case 'E':
/* Field option */