Improvements

This commit is contained in:
Gal Szkolnik 2022-10-05 21:49:54 -04:00
parent d8e37c1fdf
commit d6a9f59544
6 changed files with 48 additions and 12 deletions

View file

@ -1,5 +1,9 @@
alias which-command="type -fP "
function which-command() {
local ANSWER=$(type -t "${@}") || return $?
[[ $ANSWER == "function" ]] && printf "function " && type "${@}" | tail +2 && return
[[ $ANSWER == "alias" ]] && {
alias "${@}"
}
type -fP "${@}"
}