commit aa2da20176e0caa8fa5deb70c27f4be1c99cf4d5
parent 39c8c00023d812b53a1046788f87eb56f5273583
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Thu, 26 Jun 2014 19:57:53 +0200
make a verification pass when actions were performed
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bin/confz b/bin/confz
@@ -6,7 +6,7 @@ autoload -Uz colors; colors
setopt extended_glob warn_create_global no_unset
typeset -gA vars vars_prev
-typeset -ga do_command
+typeset -ga do_command actions_performed
typeset -g confz_indent check_only verbose fail_reason
: ${check_only:=0}
@@ -36,6 +36,7 @@ confz_check_fail() {
confz_do() {
print -r - "$confz_indent$fg[yellow]*$fg[default] ${(q)@}"
+ actions_performed+=( "$*" )
"$@" || die "command failed with error $?: ${(q)@}"
}
@@ -199,6 +200,9 @@ confz_main_check() {
fi
done
(( $#args )) && require $args
+
+ fail_reason="performed $#actions_performed actions, recheck"
+ return $#actions_performed
}
# noop for the toplevel, functionality is in the dependencies