formatted gulp completion and used helper function
parent
475393c6b7
commit
538c19b32f
|
|
@ -39,12 +39,16 @@
|
||||||
#
|
#
|
||||||
# eval "$(gulp --completion=bash)"
|
# eval "$(gulp --completion=bash)"
|
||||||
# Enable bash autocompletion.
|
# Enable bash autocompletion.
|
||||||
function _gulp_completions() {
|
|
||||||
# The currently-being-completed word.
|
if _command_exists gulp
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
then
|
||||||
#Grab tasks
|
function _gulp_completions() {
|
||||||
local compls=$(gulp --tasks-simple)
|
# The currently-being-completed word.
|
||||||
# Tell complete what stuff to show.
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
|
#Grab tasks
|
||||||
}
|
local compls=$(gulp --tasks-simple)
|
||||||
complete -o default -F _gulp_completions gulp
|
# Tell complete what stuff to show.
|
||||||
|
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
|
||||||
|
}
|
||||||
|
complete -o default -F _gulp_completions gulp
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue