Revision 8996
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/util.sh | ||
---|---|---|
105 | 105 |
|
106 | 106 |
limit_stderr_cmd () # usage: [stdout2stderr=1] limit_stderr_cmd cmd... |
107 | 107 |
{ |
108 |
echo_cmd "$@" |
|
108 | 109 |
(limit_stderr |
109 | 110 |
if test -n "$stdout2stderr"; then stdout2stderr; fi |
110 | 111 |
"$@" |
... | ... | |
119 | 120 |
for cmd in rm; do alias "$cmd=echo_run $cmd"; done; unset cmd |
120 | 121 |
|
121 | 122 |
# limits stderr of (and echoes) an external command |
122 |
alias limit_stderr_extern='echo_run limit_stderr_cmd "extern" '
|
|
123 |
alias limit_stderr_extern='limit_stderr_cmd "extern" ' |
|
123 | 124 |
# last space alias-expands next word |
124 | 125 |
|
125 | 126 |
# echo and limit stderr of all external commands |
Also available in: Unified diff
lib/util.sh: limit_stderr_cmd (): echo the command like echo_run so that callers don't have to separately call echo_run. this reduces clutter of the nested aliases, ensures that the command is always echoed outside of the inner stderr-limiter (which has a different log_level), and avoids echoing "limit_stderr_cmd" itself as part of the command name.