9 lines
268 B
Text
9 lines
268 B
Text
function which-command() {
|
|
local ANSWER=$(whence -w "${@}") || return $?
|
|
ANSWER=${ANSWER##*: }
|
|
[[ $ANSWER == "function" ]] && printf "function " && whence -f "${@}" && return
|
|
[[ $ANSWER == "alias" ]] && {
|
|
alias "${@}"
|
|
}
|
|
whence "${@}"
|
|
}
|