summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'etc/functions')
-rw-r--r--etc/functions/check_com32
-rw-r--r--etc/functions/help2
-rw-r--r--etc/functions/put2
3 files changed, 2 insertions, 34 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
diff --git a/etc/functions/help b/etc/functions/help
index aa0c269..db3eca1 100644
--- a/etc/functions/help
+++ b/etc/functions/help
@@ -21,7 +21,7 @@ function help_check_man { man -w $1 &> /dev/null }
function help_check_zshfunction { whichf $1 &> /dev/null }
function help_check_zshbuiltin { (( ${+builtins[$1]} )) }
function help_check_apt {
- [[ $commands[$1] != ${HOME}* ]] && check_com -c $1 && check_com -c apt-file
+ [[ $commands[$1] != ${HOME}* ]] && [[ -n $commands[$1] ]] && [[ -n $commands[apt-file ]]
}
function help_show_man { man $1 }
diff --git a/etc/functions/put b/etc/functions/put
index 40e73bd..bf512c1 100644
--- a/etc/functions/put
+++ b/etc/functions/put
@@ -11,7 +11,7 @@ typeset target_dir server_prefix
typeset file remote_file illegal
typeset -i n_hosts n_ping n_curl
-if ! check_com curl; then
+if [[ -z $commands[curl] ]]; then
function curl {return 0}
warn "curl not present, won't be able to check upload success"
fi