prezto/functions/helper.zsh
2011-09-13 19:43:41 -04:00

10 lines
336 B
Bash

# Checks if a file can be autoloaded by trying to load it in a subshell.
function autoloadable() {
( unfunction $1 ; autoload -U +X $1 ) &>/dev/null
}
# Checks boolean variable for "true" (case insensitive "1", "y", "yes", "t", and "true").
function check-bool {
[[ -n "$1" && "$1" == (1|[Yy]([Ee][Ss]|)|[Tt]([Rr][Uu][Ee]|)) ]]
}