forked from gulpjs/gulp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes gulpjs#57
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Completion for gulp | ||
> Thanks to grunt team and Tyler Kellen | ||
To enable tasks auto-completion in shell you should add `eval "$(gulp --completion=shell)"` in your `.shellrc` file. | ||
|
||
## Bash | ||
|
||
Add `eval "$(gulp --completion=bash)"` to `~/.bashrc`. | ||
|
||
## Zsh | ||
|
||
Add `eval "$(gulp --completion=zsh)"` to `~/.zshrc`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Borrowed from grunt-cli | ||
* http://gruntjs.com/ | ||
* | ||
* Copyright (c) 2012 Tyler Kellen, contributors | ||
* Licensed under the MIT license. | ||
* https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
exports.print = function(name) { | ||
var code = 0; | ||
var filepath = path.join(__dirname, '../completion', name); | ||
var output; | ||
try { | ||
output = String(fs.readFileSync(filepath)); | ||
} catch (err) { | ||
code = 5; | ||
output = 'echo "Specified gulp shell auto-completion rules '; | ||
if (name && name !== 'true') { | ||
output += 'for \'' + name + '\' '; | ||
} | ||
output += 'not found."'; | ||
} | ||
|
||
console.log(output); | ||
process.exit(code); | ||
}; |