2022-10-06 01:49:54 +00:00
|
|
|
function which-command() {
|
|
|
|
local ANSWER=$(whence -w "${@}") || return $?
|
|
|
|
ANSWER=${ANSWER##*: }
|
|
|
|
[[ $ANSWER == "function" ]] && printf "function " && whence -f "${@}" && return
|
|
|
|
[[ $ANSWER == "alias" ]] && {
|
|
|
|
alias "${@}"
|
|
|
|
}
|
|
|
|
whence "${@}"
|
|
|
|
}
|