formatted gulp completion and used helper function

pull/1782/head
Gurkirat Singh 2021-01-10 19:24:47 +05:30
parent 475393c6b7
commit 538c19b32f
No known key found for this signature in database
GPG Key ID: CFD64E1DCB3DA835
1 changed files with 13 additions and 9 deletions

View File

@ -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