- silence more unset variable warnings in CVS completion

This commit is contained in:
ianmacd 2003-02-06 18:06:29 +00:00
parent 72773eac8e
commit ff77299fb6

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05b
#
# $Id: bash_completion,v 1.524 2003/02/01 22:39:25 ianmacd Exp $
# $Id: bash_completion,v 1.525 2003/02/06 19:06:29 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
@ -995,7 +995,7 @@ get_entries()
{
[ -r ${prefix:-}CVS/Entries ] && \
entries=( $( compgen -W \
"$( echo $( cut -d/ -f2 -s ${prefix}CVS/Entries ) )" -- $cur ) )
"$( echo $( cut -d/ -f2 -s ${prefix:-}CVS/Entries ) )" -- $cur ) )
}
get_modules()
@ -1069,12 +1069,12 @@ _cvs()
add)
if [[ "$cur" != -* ]]; then
set_prefix
if [ $COMP_CWORD -gt 1 -a -r ${prefix}CVS/Entries ]; then
if [ $COMP_CWORD -gt 1 -a -r ${prefix:-}CVS/Entries ]; then
get_entries
[ -z "$cur" ] && \
files=$( command ls -Ad !(CVS) ) || \
files=$( command ls -d ${cur}* 2>/dev/null )
for i in ${entries[@]}; do
for i in ${entries[@]:-}; do
files=( ${files[@]/#$i//} )
done
COMPREPLY=( $( compgen -W '${files[@]}' -- \
@ -1149,13 +1149,13 @@ _cvs()
remove)
if [[ "$cur" != -* ]]; then
set_prefix
if [ $COMP_CWORD -gt 1 -a -r ${prefix}CVS/Entries ]; then
if [ $COMP_CWORD -gt 1 -a -r ${prefix:-}CVS/Entries ]; then
get_entries
# find out what files are missing
for i in ${entries[@]}; do
[ ! -r "$i" ] && miss=( ${miss[@]} $i )
[ ! -r "$i" ] && miss=( ${miss[@]:-} $i )
done
COMPREPLY=( $(compgen -W '${miss[@]}' -- $cur) )
COMPREPLY=( $(compgen -W '${miss[@]:-}' -- $cur) )
fi
else
COMPREPLY=( $( compgen -W '-f -l -R' -- $cur ) )