mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-02-02 05:41:15 +01:00
reverted color=0 for json and csv formats; rewrote strip_quote to cross platform variant.
This commit is contained in:
parent
520966f776
commit
8d285a8696
@ -695,7 +695,7 @@ set_color_functions() {
|
|||||||
strip_quote() {
|
strip_quote() {
|
||||||
# remove color codes (see http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed)
|
# remove color codes (see http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed)
|
||||||
# \', leading and all trailing spaces
|
# \', leading and all trailing spaces
|
||||||
sed -e "s,\x1B\[[0-9;]*[a-zA-Z],,g" \
|
sed -e "s,$(echo -e "\033")\[[0-9;]*[a-zA-Z],,g" \
|
||||||
-e "s/\"/\\'/g" \
|
-e "s/\"/\\'/g" \
|
||||||
-e 's/^ *//g' \
|
-e 's/^ *//g' \
|
||||||
-e 's/ *$//g' <<< "$1"
|
-e 's/ *$//g' <<< "$1"
|
||||||
@ -10830,22 +10830,18 @@ parse_cmd_line() {
|
|||||||
do_logging=true
|
do_logging=true
|
||||||
;;
|
;;
|
||||||
--json)
|
--json)
|
||||||
COLOR=0
|
|
||||||
do_json=true
|
do_json=true
|
||||||
;; # DEFINITION of JSONFILE is not arg specified: automagically in parse_hn_port()
|
;; # DEFINITION of JSONFILE is not arg specified: automagically in parse_hn_port()
|
||||||
# following does the same but we can specify a log location additionally
|
# following does the same but we can specify a log location additionally
|
||||||
--jsonfile|--jsonfile=*)
|
--jsonfile|--jsonfile=*)
|
||||||
COLOR=0
|
|
||||||
JSONFILE=$(parse_opt_equal_sign "$1" "$2")
|
JSONFILE=$(parse_opt_equal_sign "$1" "$2")
|
||||||
[[ $? -eq 0 ]] && shift
|
[[ $? -eq 0 ]] && shift
|
||||||
do_json=true
|
do_json=true
|
||||||
;;
|
;;
|
||||||
--json-pretty)
|
--json-pretty)
|
||||||
COLOR=0
|
|
||||||
do_pretty_json=true
|
do_pretty_json=true
|
||||||
;;
|
;;
|
||||||
--jsonfile-pretty|--jsonfile-pretty=*)
|
--jsonfile-pretty|--jsonfile-pretty=*)
|
||||||
COLOR=0
|
|
||||||
JSONFILE=$(parse_opt_equal_sign "$1" "$2")
|
JSONFILE=$(parse_opt_equal_sign "$1" "$2")
|
||||||
[[ $? -eq 0 ]] && shift
|
[[ $? -eq 0 ]] && shift
|
||||||
do_pretty_json=true
|
do_pretty_json=true
|
||||||
@ -10858,12 +10854,10 @@ parse_cmd_line() {
|
|||||||
GIVE_HINTS=true
|
GIVE_HINTS=true
|
||||||
;;
|
;;
|
||||||
--csv)
|
--csv)
|
||||||
COLOR=0
|
|
||||||
do_csv=true
|
do_csv=true
|
||||||
;; # DEFINITION of CSVFILE is not arg specified: automagically in parse_hn_port()
|
;; # DEFINITION of CSVFILE is not arg specified: automagically in parse_hn_port()
|
||||||
# following does the same but we can specify a log location additionally
|
# following does the same but we can specify a log location additionally
|
||||||
--csvfile|--csvfile=*)
|
--csvfile|--csvfile=*)
|
||||||
COLOR=0
|
|
||||||
CSVFILE=$(parse_opt_equal_sign "$1" "$2")
|
CSVFILE=$(parse_opt_equal_sign "$1" "$2")
|
||||||
[[ $? -eq 0 ]] && shift
|
[[ $? -eq 0 ]] && shift
|
||||||
do_csv=true
|
do_csv=true
|
||||||
|
Loading…
Reference in New Issue
Block a user