Skip to content

Instantly share code, notes, and snippets.

@oflow
Last active July 21, 2017 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oflow/8984023fda81529926d20b80d4c4198b to your computer and use it in GitHub Desktop.
Save oflow/8984023fda81529926d20b80d4c4198b to your computer and use it in GitHub Desktop.
gulp はタスク名を補完しろよ
compdef _gulp gulp
function _gulp () {
local -a task
if [ -f ./gulpfile.js ]; then
task=(`cat gulpfile.js | grep "task('" | awk -F\' '{ print $2 }' | tr '\n' ' '`)
compadd $task
else
zle -M 'No gulpfile found'
fi
}
# https://github.com/gulpjs/gulp/blob/master/completion/zsh
# gulp --tasks-simple とかで良かった
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment