mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-11-01 03:51:12 +00:00
Rename autoloadable to is-autoloadable
This commit is contained in:
parent
3d5e302777
commit
10f333f45c
@ -5,10 +5,9 @@
|
|||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
#
|
#
|
||||||
|
|
||||||
# Checks a boolean variable for "true".
|
# Checks if a file can be autoloaded by trying to load it in a subshell.
|
||||||
# Case insensitive: "1", "y", "yes", "t", "true", "o", and "on".
|
function is-autoloadable {
|
||||||
function is-true {
|
( unfunction $1 ; autoload -U +X $1 ) &> /dev/null
|
||||||
[[ -n "$1" && "$1" == (1|[Yy]([Ee][Ss]|)|[Tt]([Rr][Uu][Ee]|)|[Oo]([Nn]|)) ]]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Checks a name if it is a command, function, or alias.
|
# Checks a name if it is a command, function, or alias.
|
||||||
@ -16,6 +15,12 @@ function is-callable {
|
|||||||
(( $+commands[$1] )) || (( $+functions[$1] )) || (( $+aliases[$1] ))
|
(( $+commands[$1] )) || (( $+functions[$1] )) || (( $+aliases[$1] ))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Checks a boolean variable for "true".
|
||||||
|
# Case insensitive: "1", "y", "yes", "t", "true", "o", and "on".
|
||||||
|
function is-true {
|
||||||
|
[[ -n "$1" && "$1" == (1|[Yy]([Ee][Ss]|)|[Tt]([Rr][Uu][Ee]|)|[Oo]([Nn]|)) ]]
|
||||||
|
}
|
||||||
|
|
||||||
# Prints the first non-empty string in the arguments array.
|
# Prints the first non-empty string in the arguments array.
|
||||||
function coalesce {
|
function coalesce {
|
||||||
for arg in $argv; do
|
for arg in $argv; do
|
||||||
@ -25,8 +30,3 @@ function coalesce {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user