prezto/functions/helper.zsh

11 lines
336 B
Bash
Raw Normal View History

2011-07-28 16:41:39 -04:00
# 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]|)) ]]
}