1
# bash completion for rcs
6
local cur prev file dir i
9
_get_comp_words_by_ref cur prev
14
# deal with relative directory
15
[ "$file" = "$dir" ] && dir=.
17
COMPREPLY=( $( compgen -f "$dir/RCS/$file" ) )
19
for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
20
file=${COMPREPLY[$i]##*/}
21
dir=${COMPREPLY[$i]%RCS/*}
22
COMPREPLY[$i]=$dir$file
25
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -G "$dir/$file*,v" ) )
27
for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
28
COMPREPLY[$i]=${COMPREPLY[$i]%,v}
31
# default to files if nothing returned and we're checking in.
32
# otherwise, default to directories
33
[[ ${#COMPREPLY[@]} -eq 0 && $1 == ci ]] && _filedir || _filedir -d
35
complete -F _rcs ci co rlog rcs rcsdiff
40
# sh-indent-comment: t
41
# indent-tabs-mode: nil
43
# ex: ts=4 sw=4 et filetype=sh