bali out if both flat and pretty JSON outout was specified

This commit is contained in:
Dirk 2017-07-10 10:57:48 +02:00
parent bc0c1dc553
commit 637812a022
1 changed files with 4 additions and 0 deletions

View File

@ -13081,18 +13081,22 @@ parse_cmd_line() {
do_logging=true
;;
--json)
$do_pretty_json && JSONHEADER=false && fatal "flat and pretty JSON output are mutually exclusive" 251
do_json=true
;; # DEFINITION of JSONFILE is not arg specified: automagically in parse_hn_port()
# following does the same but we can specify a log location additionally
--jsonfile|--jsonfile=*)
$do_pretty_json && JSONHEADER=false && fatal "flat and pretty JSON output are mutually exclusive" 251
JSONFILE="$(parse_opt_equal_sign "$1" "$2")"
[[ $? -eq 0 ]] && shift
do_json=true
;;
--json-pretty)
$do_json && JSONHEADER=false && fatal "flat and pretty JSON output are mutually exclusive" 251
do_pretty_json=true
;;
--jsonfile-pretty|--jsonfile-pretty=*)
$do_json && JSONHEADER=false && fatal "flat and pretty JSON output are mutually exclusive" 251
JSONFILE="$(parse_opt_equal_sign "$1" "$2")"
[[ $? -eq 0 ]] && shift
do_pretty_json=true