-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new rake targets in bash_completion, refine script and README
- Loading branch information
Showing
2 changed files
with
28 additions
and
11 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
# octopress_bash_completion | ||
This will auto complete options for used in [Octopress](http://octopress.org/) | ||
This will auto complete targets for used in [Octopress](http://octopress.org/) | ||
|
||
--- | ||
# Install | ||
* copy rake to /etc/bash_completion.d/ | ||
* relogin or `. /etc/bash_completion.d/rake` | ||
|
||
# Auto complete options | ||
* deploy | ||
* generate | ||
* preview | ||
* watch | ||
# Auto complete targets | ||
* deploy | ||
* generate | ||
* preview | ||
* watch | ||
* new_post | ||
* new_page | ||
* isolate | ||
* integrate | ||
* clean | ||
* update_style | ||
* update_source | ||
* gen_deploy | ||
* copydot | ||
* rsync | ||
* set_root_dir | ||
* setup_github_pages | ||
* list | ||
* -T | ||
* install | ||
|
||
# Tested environment | ||
* Ubuntu 14.04 | ||
|
||
# Reference | ||
* [An introduction to bash completion: part 1](http://www.debian-administration.org/article/316/An_introduction_to_bash_completion_part_1) | ||
* [An introduction to bash completion: part 2](http://www.debian-administration.org/article/317/An_introduction_to_bash_completion_part_2) | ||
* [An introduction to bash completion: part 2](http://www.debian-administration.org/article/317/An_introduction_to_bash_completion_part_2) |
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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
_rake() | ||
{ | ||
local cur prev opts | ||
local current_keyin_str targets | ||
COMPREPLY=() | ||
cur="${COMP_WORDS[COMP_CWORD]}" | ||
opts="deploy generate preview watch new_post" | ||
current_keyin_str="${COMP_WORDS[COMP_CWORD]}" | ||
targets="deploy generate preview watch new_post new_page isolate \ | ||
integrate clean update_style update_source gen_deploy \ | ||
copydot rsync set_root_dir setup_github_pages list -T \ | ||
install" | ||
|
||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | ||
COMPREPLY=( $(compgen -W "${targets}" -- ${current_keyin_str}) ) | ||
} | ||
complete -F _rake rake |