diff options
Diffstat (limited to 'completions/rcs')
-rw-r--r-- | completions/rcs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/completions/rcs b/completions/rcs index cfad0211..c04d89d2 100644 --- a/completions/rcs +++ b/completions/rcs @@ -11,26 +11,26 @@ _rcs() dir=${cur%/*} # deal with relative directory - [[ $file == $dir ]] && dir=. + [[ $file == "$dir" ]] && dir=. - COMPREPLY=( $(compgen -f -- "$dir/RCS/$file") ) + COMPREPLY=($(compgen -f -- "$dir/RCS/$file")) - for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do - file=${COMPREPLY[$i]##*/} - dir=${COMPREPLY[$i]%RCS/*} - COMPREPLY[$i]=$dir$file + for i in ${!COMPREPLY[*]}; do + file=${COMPREPLY[i]##*/} + dir=${COMPREPLY[i]%RCS/*} + COMPREPLY[i]=$dir$file done - COMPREPLY+=( $(compgen -G "$dir/$file*,v") ) + COMPREPLY+=($(compgen -G "$dir/$file*,v")) - for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do - COMPREPLY[$i]=${COMPREPLY[$i]%,v} + for i in ${!COMPREPLY[*]}; do + COMPREPLY[i]=${COMPREPLY[i]%,v} done # default to files if nothing returned and we're checking in. # otherwise, default to directories [[ ${#COMPREPLY[@]} -eq 0 && $1 == *ci ]] && _filedir || _filedir -d } && -complete -F _rcs ci co rlog rcs rcsdiff + complete -F _rcs ci co rlog rcs rcsdiff # ex: filetype=sh |