Project

General

Profile

« Previous | Next » 

Revision 9302

lib/sh/util.sh: logging: log++/--: comment about the different uses can be performed with one function: clarified that without a cmd, "$@" expands to nothing and assignments are applied to the caller

View differences:

util.sh
181 181
# usage: in func:      log++; ...         OR  log_local; "log++"; ...
182 182
#        outside func: log++; ...; log--
183 183
#        before cmd:   log++ cmd...
184
# with no args, "$@" expands to nothing and var assignments applied to caller
184
# without a cmd, "$@" expands to nothing and assignments are applied to caller
185 185
log++() { PS4="${PS4:0:1}$PS4"    verbosity=$((verbosity-1)) "$@"; }
186 186
log--() { PS4="${PS4#${PS4:0:1}}" verbosity=$((verbosity+1)) "$@"; }
187 187
alias log_local='declare PS4="$PS4" verbosity="$verbosity"'

Also available in: Unified diff