diff options
author | Matthieu Coudron <mattator@gmail.com> | 2015-09-12 17:40:55 +0200 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-09-12 20:19:59 +0000 |
commit | 68dd2c823aff0c79263c9bf8feabe031b747c0cc (patch) | |
tree | 4fd82ddc89ac55a8e46fbc17aea1a6a78549a933 /tshark.c | |
parent | 722174359edf4e756904d8752c1f65247fd2d20d (diff) |
Display the name of the invalid field when tshark is run with -T fields
-e invalidfield
Change-Id: Iaf8733096d9e1d15510a38363397b1dcd972ff59
Reviewed-on: https://code.wireshark.org/review/10504
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -2030,11 +2030,19 @@ DIAG_ON(cast-qual) /* At this point MATE will have registered its field array so we can check if the fields specified by the user are all good. */ - if (!output_fields_valid(output_fields)) { - cmdarg_err("Some fields aren't valid"); - return 1; - } + { + GSList* it = NULL; + GSList *invalid_fields = output_fields_valid(output_fields); + if (invalid_fields != NULL) { + cmdarg_err("Some fields aren't valid:"); + for (it=invalid_fields; it != NULL; it = g_slist_next(it)) { + cmdarg_err_cont("\t%s", (gchar *)it->data); + } + g_slist_free(invalid_fields); + return 1; + } + } #ifdef HAVE_LIBPCAP /* We currently don't support taps, or printing dissected packets, if we're writing to a pipe. */ |