aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@es.net>2018-06-08 11:55:33 -0700
committerBruce A. Mah <bmah@es.net>2018-06-08 11:55:33 -0700
commit1254e135fdc74cef7c11fe0bd5440a9b1046c484 (patch)
tree1fbcb6a062f170542cafc283d7ab2a827729741a /src
parenta72ed8b7f9cb408d752a5724ccc4f6017e9af1a0 (diff)
downloadiperf3-1254e135fdc74cef7c11fe0bd5440a9b1046c484.tar.gz
Warn if doing JSON output and either -d or -v are specified.
Debugging and/or verbose output can get in the way of producing valid/parsable JSON. Inspired by #737.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/iperf_api.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/iperf_api.c b/src/iperf_api.c
index 58d4479..8b65d23 100755
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -1231,6 +1231,14 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
warning("Report format (-f) flag ignored with JSON output (-J)");
}
+ /* Show warning if JSON output is used with verbose or debug flags */
+ if (test->json_output && test->verbose) {
+ warning("Verbose output (-v) may interfere with JSON output (-J)");
+ }
+ if (test->json_output && test->debug) {
+ warning("Debug output (-d) may interfere with JSON output (-J)");
+ }
+
return 0;
}