summaryrefslogtreecommitdiff
path: root/etc/functions/check_com
diff options
context:
space:
mode:
Diffstat (limited to 'etc/functions/check_com')
-rw-r--r--etc/functions/check_com32
1 files changed, 0 insertions, 32 deletions
diff --git a/etc/functions/check_com b/etc/functions/check_com
deleted file mode 100644
index 21de466..0000000
--- a/etc/functions/check_com
+++ /dev/null
@@ -1,32 +0,0 @@
-## vim:ft=zsh
-## Check for a command/function
-## Usage: check_com [-c] <command>
-## Taken from the grml zshrc - http://grml.org
-local -i comonly
-
-if [[ ${1} == '-c' ]] ; then
- (( comonly = 1 ))
- shift
-else
- (( comonly = 0 ))
-fi
-
-if (( ${#argv} != 1 )) ; then
- printf 'usage: check_com [-c] <command>\n' >&2
- return 1
-fi
-
-if (( comonly > 0 )) ; then
- [[ -n ${commands[$1]} ]] && return 0
- return 1
-fi
-
-if [[ -n ${commands[$1]} ]] \
- || [[ -n ${functions[$1]} ]] \
- || [[ -n ${aliases[$1]} ]] \
- || [[ -n ${reswords[(r)$1]} ]] ; then
-
- return 0
-fi
-
-return 1