From 03c6426baa8dbd354247da47e2488ba048733a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Barto=C5=A1?= Date: Wed, 19 Apr 2023 21:26:26 +0200 Subject: [PATCH] unirecfilter: Print warning when using -O with -f When filters are read from file (using -f parameter), the file also contains specification of the set of fields on each output. The -O parameter is overridden/ignored in such case. This change adds a warning to notify user that the passed -O parameter has no effect. --- unirecfilter/unirecfilter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unirecfilter/unirecfilter.c b/unirecfilter/unirecfilter.c index 0af83081..39dd6c2d 100644 --- a/unirecfilter/unirecfilter.c +++ b/unirecfilter/unirecfilter.c @@ -495,6 +495,10 @@ int main(int argc, char **argv) printf("Verbosity level: %i\n", verbose); } + if (from == 1 && output_specifier_str != NULL) { + fprintf(stderr, "Warning: The -O parameter is ignored when output specification is read from a file.\n"); + } + // Count number of output interfaces n_outputs = strlen(ifc_spec.types) - 1; module_info->num_ifc_out = n_outputs;