Revision 9096
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
174 | 174 |
|
175 | 175 |
echo_cmd() |
176 | 176 |
{ |
177 |
case "$1" in command) shift;; esac # command implied by the log_level |
|
177 |
case "$1" in command) # command implied by the log_level |
|
178 |
shift |
|
179 |
case "$1" in --) shift;; esac |
|
180 |
;; esac |
|
178 | 181 |
log "$*" |
179 | 182 |
} |
180 | 183 |
|
... | ... | |
198 | 201 |
for cmd in rm; do alias "$cmd=echo_run $cmd"; done; unset cmd |
199 | 202 |
|
200 | 203 |
# echo all external commands |
201 |
alias command="echo_run command " # last space alias-expands next word |
|
204 |
alias command="echo_run command -- " # last space alias-expands next word
|
|
202 | 205 |
|
203 | 206 |
# commands that are always external |
204 | 207 |
for cmd in env; do alias "$cmd=command $cmd"; done; unset cmd |
Also available in: Unified diff
lib/sh/util.sh: command alias: also prepend -- to args to prevent a first arg starting with -- from being interpreted as an option to the `command` builtin