From 89c7efed6f7fe1d0e550acd4fadd39d67b0516f9 Mon Sep 17 00:00:00 2001 From: kazu Date: Sun, 12 Dec 2010 11:40:29 +0000 Subject: * misc/rb_optparse.zsh: update how to install. * misc/rb_optparse.zsh: avoid error when setopt noclobber. * lib/optparse.rb: fix typo. pointed out at . git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- misc/rb_optparse.zsh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'misc') diff --git a/misc/rb_optparse.zsh b/misc/rb_optparse.zsh index bd3fc53b2d..7122c7fd81 100755 --- a/misc/rb_optparse.zsh +++ b/misc/rb_optparse.zsh @@ -2,12 +2,18 @@ # Completion for zsh: # (based on ) # -# (1) install this file, +# (1) install this file. +# mkdir -p ~/.zsh.d +# cp rb_optparse.zsh ~/.zsh.d/rb_optparse.zsh # -# (2) load the script, and -# . ~/.zsh.d/rb_optparse.zsh +# (2) load the script in ~/.zshrc. +# echo '. ~/.zsh.d/rb_optparse.zsh' >> ~/.zshrc +# echo 'fpath=("${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}" $fpath)' >> ~/.zshrc +# echo 'autoload -U ${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}/*(:t)' >> ~/.zshrc # -# (3) geneate completion files once. +# (3) restart zsh. +# +# (4) geneate completion files once. # generate-complete-function/ruby/optparse COMMAND1 # generate-complete-function/ruby/optparse COMMAND2 # @@ -16,7 +22,7 @@ generate-complete-function/ruby/optparse () { local cmpl="_${1:t}" mkdir -p "${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}" - $1 "--*-completion-zsh=${1:t}" > "${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}/$cmpl" + $1 "--*-completion-zsh=${1:t}" >! "${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}/$cmpl" if [[ $(type -w "$cmpl") == "${cmpl}: function" ]]; then unfunction "$cmpl" autoload -U "$cmpl" -- cgit v1.2.3