Skip to content

Commit

Permalink
Add new rake targets in bash_completion, refine script and README
Browse files Browse the repository at this point in the history
  • Loading branch information
zzz0072 committed Mar 31, 2015
1 parent 4255ee0 commit 2c01160
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
28 changes: 21 additions & 7 deletions utils/bash_completion/README.markdown
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)
11 changes: 7 additions & 4 deletions utils/bash_completion/rake
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

0 comments on commit 2c01160

Please sign in to comment.