Skip to content

Instantly share code, notes, and snippets.

@doug
Created September 9, 2014 18:37
Show Gist options
  • Save doug/eb8990881efd07f2f4ee to your computer and use it in GitHub Desktop.
Save doug/eb8990881efd07f2f4ee to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
#
# gulp-autocompletion-zsh
#
# Autocompletion for your gulp.js tasks
#
# Copyright(c) 2014 Doug Fritz <[email protected]>
# MIT Licensed
#
#
# Doug Fritz
# Github: https://github.com/doug
# Twitter: https://twitter.com/dohug
#
function $$gulp_completion() {
compls=$(grep -Po "(?<=gulp.task\(\W['\"]).*(?=['\"])" gulpfile.js | sort)
completions=(${=compls})
compadd -- $completions
}
compdef $$gulp_completion gulp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment