Grunt tasks for zsh completion.
MIT License
Grunt tasks for zsh completion.
grunt-cli now supports bash tab completion and no longer provides a list command.
It should be possible to parse grunt --version --verbose
or use bash
completion in zsh with
bashcompinit
or bash_source.
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-shell-completion
Then add this line to your project's grunt.js
gruntfile:
grunt.loadNpmTasks('grunt-shell-completion');
Adds grunt grunt-shell-completion
to print a snippet:
~/grunt-shell-completion » grunt grunt-shell-completion
Running "grunt-shell-completion" task
# completion for grunt
function grunt_tasks {
reply=(`grunt --no-color list`)
}
compctl -K grunt_tasks grunt
Done, without errors.
And grunt list
to list available commands (if a grunt.js
file is available):
~/grunt-shell-completion » grunt list
Running "list" task
concat init lint min qunit server test watch list grunt-shell-completion default
Done, without errors.
If the completion snippet is loaded with your .zshrc
file, we can
tab complete grunt commands. For example:
~/grunt-shell-completion » grunt grunt-shell-completion | tail +2 | head -5 >> ~/.zshrc
~/grunt-shell-completion » source ~/.zshrc
~/grunt-shell-completion » grunt^TAB
\"list\" concat grunt-shell-completion list server watch
Done, default init min task without
Running errors. lint qunit test
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Copyright (c) 2012 Greg Guthe Licensed under the MIT license.