dotfiles.2022/_home/dot_sz.shrc.d/zsh.pre/21_aliases

10 lines
268 B
Plaintext

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