diff options
Diffstat (limited to 'Completion/User/_rcs')
-rw-r--r-- | Completion/User/_rcs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Completion/User/_rcs b/Completion/User/_rcs index 537db6278..1792179d7 100644 --- a/Completion/User/_rcs +++ b/Completion/User/_rcs @@ -1,9 +1,12 @@ -#defcomp co ci rcs +#compdef co ci rcs -[[ $COMMAND = ci || $COMMAND = rcs ]] && _files +local nm=$compstate[nmatches] cmd="${words[1]:t}" + +[[ $cmd = ci || $cmd = rcs ]] && _files + +if [[ $compstate[nmatches] -eq nm && -d RCS && $cmd != ci ]]; then + local rep expl -if [[ $NMATCHES -eq 0 && -d RCS && $COMMAND != ci ]]; then - local rep rep=(RCS/$PREFIX*$SUFFIX,v(:t:s/\,v//)) - (( $#rep )) && compadd -m $rep + (( $#rep )) && _wanted files expl 'RCS file' compadd - $rep fi |