| 1 |
#!/bin/zsh |
| 2 |
|
| 3 |
# Borrowed from grunt-cli |
| 4 |
# http://gruntjs.com/ |
| 5 |
# |
| 6 |
# Copyright (c) 2012 Tyler Kellen, contributors |
| 7 |
# Licensed under the MIT license. |
| 8 |
# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT |
| 9 |
|
| 10 |
# Usage: |
| 11 |
# |
| 12 |
# To enable zsh <tab> completion for gulp, add the following line (minus the |
| 13 |
# leading #, which is the zsh comment character) to your ~/.zshrc file: |
| 14 |
# |
| 15 |
# eval "$(gulp --completion=zsh)" |
| 16 |
|
| 17 |
# Enable zsh autocompletion. |
| 18 |
function _gulp_completion() { |
| 19 |
# Grab tasks |
| 20 |
compls=$(gulp --tasks-simple) |
| 21 |
completions=(${=compls}) |
| 22 |
compadd -- $completions |
| 23 |
} |
| 24 |
|
| 25 |
compdef _gulp_completion gulp |