=== modified file 'bin/confz' --- old/bin/confz 2021-01-15 18:03:40 +0000 +++ new/bin/confz 2019-02-22 04:02:32 +0000 @@ -8,11 +8,10 @@ typeset -gA vars vars_prev typeset -ga do_command actions_performed -typeset -g confz_indent check_only verbose fail_reason quiet +typeset -g confz_indent check_only verbose fail_reason : ${check_only:=0} : ${verbose:=0} -: ${quiet:=0} # helper that prints out error message and exits die() { @@ -38,13 +37,13 @@ # trace-printing helpers confz_check_start() { - (($quiet)) || print -r - "${confz_indent}checking $fg_bold[default]$1$reset_color ${(@q)argv[2,-1]} ${reset_color}[" >&2 + print -r - "${confz_indent}checking $fg_bold[default]$1$reset_color ${(@q)argv[2,-1]} ${reset_color}[" >&2 confz_indent+=" " } confz_check_ok() { confz_indent=${confz_indent% } - (($quiet)) || print -r - "$confz_indent] $fg[green]$1$reset_color OK" >&2 + print -r - "$confz_indent] $fg[green]$1$reset_color OK" >&2 } confz_check_fail() { @@ -52,12 +51,12 @@ if (($check_only)); then print -P "$confz_indent] $fg[red]$1$reset_color FAIL" >&2 else - (($quiet)) || print -P "$confz_indent] $fg[yellow]$1$reset_color NEED" >&2 + print -P "$confz_indent] $fg[yellow]$1$reset_color NEED" >&2 fi } confz_do() { - (($quiet)) || print -r - "$confz_indent$fg[yellow]*$fg[default] ${(q)@}" >&2 + print -r - "$confz_indent$fg[yellow]*$fg[default] ${(q)@}" >&2 actions_performed+=( "$*" ) "$@" || die "command failed with error $?: ${(q)@}" }