5353 local cur prev words cword comp_args
5454 _comp_initialize -n : -- " $@ " || return
5555
56- local count mode=" " i cvsroot=" " has_cvsroot=false cvsroots pwd
56+ local count mode=" " i cvsroot=" " has_cvsroot=" " cvsroots pwd
5757 local -a flags files entries changed newremoved
5858
5959 local noargopts=' !(-*|*[d]*)'
7474 -${noargopts} d)
7575 mode=cvsroot
7676 cvsroot=${words[count + 1]}
77- has_cvsroot=true
77+ has_cvsroot=" set "
7878 ;;
7979 add | ad | new)
8080 mode=add
@@ -232,7 +232,7 @@ _cvs()
232232 esac
233233
234234 if [[ $cur != -* ]]; then
235- ! " $has_cvsroot " && cvsroot=${CVSROOT-}
235+ [[ ! $has_cvsroot ]] && cvsroot=${CVSROOT-}
236236 COMPREPLY=($( cvs -d " $cvsroot " co -c 2> /dev/null |
237237 awk ' {print $1}' ) )
238238 (( ${# COMPREPLY[@]} )) &&
@@ -317,7 +317,7 @@ _cvs()
317317 esac
318318
319319 if [[ $cur != -* ]]; then
320- ! " $has_cvsroot " && cvsroot=${CVSROOT-}
320+ [[ ! $has_cvsroot ]] && cvsroot=${CVSROOT-}
321321 COMPREPLY=($( cvs -d " $cvsroot " co -c | awk ' {print $1}' ) )
322322 (( ${# COMPREPLY[@]} )) &&
323323 COMPREPLY=($( compgen -W ' "${COMPREPLY[@]}"' -- " $cur " ) )
@@ -339,7 +339,7 @@ _cvs()
339339
340340 if [[ $cur != -* ]]; then
341341 # starts with same algorithm as checkout
342- ! " $has_cvsroot " && cvsroot=${CVSROOT-}
342+ [[ ! $has_cvsroot ]] && cvsroot=${CVSROOT-}
343343 local prefix=${cur%/* }
344344 if [[ -r ${cvsroot} /${prefix} ]]; then
345345 _cvs_modules
0 commit comments