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.
This commit is contained in:
Bruce A. Mah 2018-06-08 11:55:33 -07:00
parent a72ed8b7f9
commit 1254e135fd
No known key found for this signature in database
GPG Key ID: 4984910A8CAAEE8A

View File

@ -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;
}