gulp.plugin.zsh 527 Bytes
Newer Older
André König's avatar
André König committed
1
2
3
4
#!/usr/bin/env zsh

#
# gulp-autocompletion-zsh
5
#
André König's avatar
André König committed
6
7
8
9
# Autocompletion for your gulp.js tasks
#
# Copyright(c) 2014 André König <andre.koenig@posteo.de>
# MIT Licensed
10
#
André König's avatar
André König committed
11
12
13
14
15
16
17
18
19
20
21

#
# André König
# Github: https://github.com/akoenig
# Twitter: https://twitter.com/caiifr
#

#
# Grabs all available tasks from the `gulpfile.js`
# in the current directory.
#
22
function $$gulp_completion {
Giordano Vicari's avatar
Giordano Vicari committed
23
    local compls=$(gulp --tasks-simple 2>/dev/null)
André König's avatar
André König committed
24

Giordano Vicari's avatar
Giordano Vicari committed
25
    local completions=(${=compls})
André König's avatar
André König committed
26
27
28
    compadd -- $completions
}

29
compdef $$gulp_completion gulp