Revision 9011
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/util.sh | ||
---|---|---|
133 | 133 |
alias limit_stderr_extern='limit_stderr_cmd echo_run "extern" ' |
134 | 134 |
# last space alias-expands next word |
135 | 135 |
|
136 |
# echo and limit stderr of all external commands
|
|
137 |
alias extern="limit_stderr_extern " # last space alias-expands next word
|
|
136 |
# echo all external commands |
|
137 |
alias extern="echo_run extern " # last space alias-expands next word
|
|
138 | 138 |
|
139 | 139 |
alias self='extern "$FUNCNAME"' # usage: wrapper () { self ...; } |
140 | 140 |
|
... | ... | |
271 | 271 |
# usage: set_make_vars; to_target cmd... |
272 | 272 |
alias to_target='stdout="$target" to_file ' # last space alias-expands next word |
273 | 273 |
|
274 |
make () { echo_func; stdout2stderr=1 self "$@"; } |
|
274 |
make () { echo_func; stdout2stderr=1 limit_stderr_cmd self "$@"; }
|
|
275 | 275 |
|
276 | 276 |
if false; then ## usage: |
277 | 277 |
inline_make 3<<'EOF' |
... | ... | |
303 | 303 |
|
304 | 304 |
zip () |
305 | 305 |
{ |
306 |
stdout2stderr=1 try self "$@" |
|
306 |
stdout2stderr=1 try limit_stderr_cmd self "$@"
|
|
307 | 307 |
ignore 12 # "zip has nothing to do" (`man zip`) |
308 | 308 |
end_try |
309 | 309 |
} |
310 | 310 |
|
311 |
unzip () { stdout2stderr=1 self "$@"; } |
|
311 |
unzip () { stdout2stderr=1 limit_stderr_cmd self "$@"; }
|
|
312 | 312 |
|
313 | 313 |
set_inv force |
314 | 314 |
alias zip_newer='zip ${no_force:+-u }' |
Also available in: Unified diff
lib/util.sh: specify limit_stderr_cmd just for the (few) commands that need it, rather than for all commands, so that commands that use stderr to print important error messages don't have those error messages hidden when the verbosity is too low. (error messages should always be displayed, regardless of the verbosity.)