Zsh, Subversion 자동완성(Tab Completion) 수정
Thursday, 16. October 2008, 02:14:48
OS : Kubuntu 8.04 64bit AMD
Subversion 1.5.1
Zsh 4.3.4
Zsh에서 Subversion 자동완성이 Subversion 1.5이상 버전이 되면서 잘 안되었다.
불편함을 참고 쓰다가 오늘 맘먹고 찾아서 해결 했다.
방법1)
참고사이트:
http://mkoga.wordpress.com/2008/09/09/zsh-tab-completion-fix-for-subversion-15/
방법2) <= 현재 내가 사용하는 방식이다.
뭐가 틀린가? diff로 확인 해 보면 틀린게 별거 없다.
arg를 ARG로 대소문자 때문에 에러가 발생하는것 같다. ㅡ.ㅡ;;;

_subversion_diff01.png
_subversion
_subversion_20081016.diff
Subversion 1.5.1
Zsh 4.3.4
Zsh에서 Subversion 자동완성이 Subversion 1.5이상 버전이 되면서 잘 안되었다.
% svn add sr<TAB> _arguments:comparguments:303: invalid argument: ARG
불편함을 참고 쓰다가 오늘 맘먹고 찾아서 해결 했다.
방법1)
참고사이트:
http://mkoga.wordpress.com/2008/09/09/zsh-tab-completion-fix-for-subversion-15/
% cd /usr/share/zsh/4.3.4/functions/Completion/Unix % sudo wget http://gvn.googlecode.com/svn/trunk/contrib/zsh/_subversion
방법2) <= 현재 내가 사용하는 방식이다.
% mkdir ~/.zshfunc % cd ~/.zshfunc % wget http://gvn.googlecode.com/svn/trunk/contrib/zsh/_subversion % cat ~/.zshrc ... fpath=(~/.zshfunc $fpath) autoload -U ~/.zshfunc/_*(:t) %.zshrc의 맨 밑에 두줄을 추가 한다.
뭐가 틀린가? diff로 확인 해 보면 틀린게 별거 없다.
arg를 ARG로 대소문자 때문에 에러가 발생하는것 같다. ㅡ.ㅡ;;;
% diff -Naur /usr/share/zsh/4.3.4/functions/Completion/Unix/_subversion ~/.zshfunc/_subversion
--- /usr/share/zsh/4.3.4/functions/Completion/Unix/_subversion 2007-11-01 09:41:37.000000000 +0900
+++ /home/x/.zshfunc/_subversion 2008-03-08 08:39:24.000000000 +0900
@@ -30,7 +30,7 @@
usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"}:#usage:*}#usage:*$cmd] }
args=(
- ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+ ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ ARG/:ARG:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:ARG:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
)
case $cmd in;
@@ -41,7 +41,7 @@
;;
(commit)
args=(
- ${args/(#b)(*--file*):arg:/$match[1]:file:_files}
+ ${args/(#b)(*--file*):ARG:/$match[1]:file:_files}
'*:file:_files -g "*(e:_svn_status:)"'
)
;;
@@ -81,7 +81,7 @@
(propset)
args=(
':propname:(svn:ignore svn:keywords svn:executable svn:eol-style svn:mime-type svn:externals svn:needs-lock)'
- ${args/(#b)(*--file*):arg:/$match[1]:file:_files}
+ ${args/(#b)(*--file*):ARG:/$match[1]:file:_files}
'*:path or url: _alternative "files:file:_files" "urls:URL:_svn_urls"'
)
;;
@@ -148,7 +148,7 @@
usage=${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"}:#$cmd:usage:*}#$cmd: usage: svnadmin $cmd }
args=(
- ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+ ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ ARG/:ARG:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:ARG:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
)
if [[ $_svnadmin_subcmd_usage == *REPOS_PATH* ]]; then
args+=( ":path:_files -/" )
%

_subversion_diff01.png
_subversion
_subversion_20081016.diff










