@@ -530,6 +530,15 @@ outln() { printf -- "%b" "$1\n"; html_out "$(html_reserved "$1")\n"; }
530530#TODO: Still no shell injection safe but if just run it from the cmd line: that's fine
531531
532532# Color print functions, see also https://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
533+ tm_liteblue() { [[ "$COLOR" -ge 2 ]] && ( "$COLORBLIND" && tm_out "\033[0;32m$1" || tm_out "\033[0;34m$1" ) || tm_out "$1"; tm_off; } # not yet used
534+ pr_liteblue() { tm_liteblue "$1"; [[ "$COLOR" -ge 2 ]] && ( "$COLORBLIND" && html_out "<span style=\"color:#008817;\">$(html_reserved "$1")</span>" || html_out "<span style=\"color:#0000ee;\">$(html_reserved "$1")</span>" ) || html_out "$(html_reserved "$1")"; }
535+ tmln_liteblue() { tm_liteblue "$1"; tmln_out; }
536+ prln_liteblue() { pr_liteblue "$1"; outln; }
537+
538+ tm_blue() { [[ "$COLOR" -ge 2 ]] && ( "$COLORBLIND" && tm_out "\033[1;32m$1" || tm_out "\033[1;34m$1" ) || tm_out "$1"; tm_off; } # used for head lines of single tests
539+ pr_blue() { tm_blue "$1"; [[ "$COLOR" -ge 2 ]] && ( "$COLORBLIND" && html_out "<span style=\"color:#008817;font-weight:bold;\">$(html_reserved "$1")</span>" || html_out "<span style=\"color:#5c5cff;font-weight:bold;\">$(html_reserved "$1")</span>" ) || html_out "$(html_reserved "$1")"; }
540+ tmln_blue() { tm_blue "$1"; tmln_out; }
541+ prln_blue() { pr_blue "$1"; outln; }
533542
534543# we should be able to use aliases here
535544tm_warning() { [[ "$COLOR" -ge 2 ]] && tm_out "\033[0;35m$1" || tm_underline "$1"; tm_off; } # some local problem: one test cannot be done
@@ -553,6 +562,11 @@ tmln_cyan() { tm_cyan "$1"; tmln_out; }
553562pr_cyan() { tm_cyan "$1"; [[ "$COLOR" -ge 2 ]] && html_out "<span style=\"color:#0d7ea2;font-weight:bold;\">$(html_reserved "$1")</span>" || html_out "$(html_reserved "$1")"; }
554563prln_cyan() { pr_cyan "$1"; outln; }
555564
565+ tm_litegrey() { [[ "$COLOR" -ne 0 ]] && tm_out "\033[0;37m$1" || tm_out "$1"; tm_off; } # ... https://github.com/drwetter/testssl.sh/pull/600#issuecomment-276129876
566+ tmln_litegrey() { tm_litegrey "$1"; tmln_out; } # not really usable on a black background, see ..
567+ prln_litegrey() { pr_litegrey "$1"; outln; }
568+ pr_litegrey() { tm_litegrey "$1"; [[ "$COLOR" -ne 0 ]] && html_out "<span style=\"color:#71767a;\">$(html_reserved "$1")</span>" || html_out "$(html_reserved "$1")"; }
569+
556570tm_grey() { [[ "$COLOR" -ne 0 ]] && tm_out "\033[1;30m$1" || tm_out "$1"; tm_off; }
557571pr_grey() { tm_grey "$1"; [[ "$COLOR" -ne 0 ]] && html_out "<span style=\"color:#757575;font-weight:bold;\">$(html_reserved "$1")</span>" || html_out "$(html_reserved "$1")"; }
558572tmln_grey() { tm_grey "$1"; tmln_out; }
@@ -629,6 +643,7 @@ tm_reverse_bold() { [[ "$COLOR" -ne 0 ]] && tm_out "\033[7m\033[1m$1" || tm_out
629643pr_reverse() { tm_reverse "$1"; [[ "$COLOR" -ne 0 ]] && html_out "<span style=\"color:white;background-color:black;\">$(html_reserved "$1")</span>" || html_out "$(html_reserved "$1")"; }
630644pr_reverse_bold() { tm_reverse_bold "$1"; [[ "$COLOR" -ne 0 ]] && html_out "<span style=\"color:white;background-color:black;font-weight:bold;\">$(html_reserved "$1")</span>" || html_out "$(html_reserved "$1")"; }
631645
646+ #pr_headline() { pr_blue "$1"; }
632647#https://misc.flogisoft.com/bash/tip_colors_and_formatting
633648
634649#pr_headline() { [[ "$COLOR" -ge 2 ]] && out "\033[1;30m\033[47m$1" || out "$1"; tm_off; }
@@ -637,6 +652,11 @@ tmln_headline() { tm_headline "$1"; tmln_out; }
637652pr_headline() { tm_headline "$1"; [[ "$COLOR" -ne 0 ]] && html_out "<span style=\"text-decoration:underline;font-weight:bold;\">$(html_reserved "$1")</span>" || html_out "$(html_reserved "$1")"; }
638653pr_headlineln() { pr_headline "$1" ; outln; }
639654
655+ tm_squoted() { tm_out "'$1'"; }
656+ pr_squoted() { out "'$1'"; }
657+ tm_dquoted() { tm_out "\"$1\""; }
658+ pr_dquoted() { out "\"$1\""; }
659+
640660# either files couldn't be found or openssl isn't good enough (which shouldn't happen anymore)
641661tm_local_problem() { tm_warning "Local problem: $1"; }
642662tmln_local_problem() { tmln_warning "Local problem: $1"; }
0 commit comments