From c5f1b07510e54d19f3088bfd1a829b92d2b7a35d Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 16 May 2000 00:07:06 +0000 Subject: 11394: Completion/User/_cvs: rewrite filename completion functions. --- Completion/User/_cvs | 293 ++++++++++++++++++++++++++------------------------- 1 file changed, 151 insertions(+), 142 deletions(-) (limited to 'Completion/User/_cvs') diff --git a/Completion/User/_cvs b/Completion/User/_cvs index ebd3f4d7a..ee3a779e7 100644 --- a/Completion/User/_cvs +++ b/Completion/User/_cvs @@ -36,7 +36,7 @@ _cvs () { (( $+functions[_cvs_command] )) || _cvs_command () { - local cmd + local cmd cvsroot="${opt_args[-d]:Q}" typeset -A cmds cmds=(add " ad new " admin " adm rcs " annotate " ann " checkout " co get " commit " ci com " diff " di dif " @@ -432,7 +432,16 @@ _cvs_remove () { '-f[force to remove]' \ '(-R)-l[don'\''t recursive]' \ '(-l)-R[recursive]' \ - '*:file:_cvs_files_removed' + '*:file:_cvs_remove_arg' +} + +(( $+functions[_cvs_remove_arg] )) || +_cvs_remove_arg () { + if (( $+opt_args[-f] )); then + _cvs_files + else + _cvs_files_removed + fi } (( $+functions[_cvs_rtag] )) || @@ -548,11 +557,12 @@ _cvs_watchers () { (( $+functions[_cvs_loadstat] )) || _cvs_loadstat () { - zstyle -t ":completion:${curcontext}:" disable-stat && return - (( $+_cvs_loadstat_tried )) && return - _cvs_loadstat_tried=yes + zstyle -t ":completion:${curcontext}:" disable-stat && return 1 + (( $+_cvs_loadstat_status )) && return $_cvs_loadstat_status zmodload -i zsh/stat 2>/dev/null + (( _cvs_loadstat_status = ! $+builtins[stat] )) + return $_cvs_loadstat_status } (( $+functions[_cvs_root] )) || @@ -562,8 +572,7 @@ _cvs_root () { typeset -gU _cvs_roots if [[ -f "${cvspassfile::=${CVS_PASSFILE:-$HOME/.cvspass}}" ]]; then - _cvs_loadstat - if (( $+builtins[stat] )); then + if _cvs_loadstat; then id="$(LC_ALL=C builtin stat -g +mtime -F '%Y/%m/%d-%T' "$cvspassfile")" else id="$(LC_ALL=C ls -l "$cvspassfile")" @@ -629,14 +638,26 @@ _cvs_m () { (( $+functions[_cvs_modules] )) || _cvs_modules () { - local root=$CVSROOT expl - + local root="$CVSROOT" expl [[ -f CVS/Root ]] && root=$(