From 2c01160e91738ff5956f10903a0662520e4934b1 Mon Sep 17 00:00:00 2001 From: "Wen.Liao" Date: Tue, 31 Mar 2015 23:22:13 +0800 Subject: [PATCH] Add new rake targets in bash_completion, refine script and README --- utils/bash_completion/README.markdown | 28 ++++++++++++++++++++------- utils/bash_completion/rake | 11 +++++++---- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/utils/bash_completion/README.markdown b/utils/bash_completion/README.markdown index 49154f135a3..ec6f7e9792b 100644 --- a/utils/bash_completion/README.markdown +++ b/utils/bash_completion/README.markdown @@ -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) \ No newline at end of file +* [An introduction to bash completion: part 2](http://www.debian-administration.org/article/317/An_introduction_to_bash_completion_part_2) diff --git a/utils/bash_completion/rake b/utils/bash_completion/rake index b6a6fdf209e..1e02f455d2c 100644 --- a/utils/bash_completion/rake +++ b/utils/bash_completion/rake @@ -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