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