release updated to 20020124

call _expand() from some of the completion routines()
find now performs default completion, rather than dirnames, if nothing else
  is returned
This commit is contained in:
ianmacd 2002-01-24 04:03:26 +00:00
parent 00c593b279
commit a06bbf97ed

View File

@ -2,7 +2,7 @@
# #
# <![CDATA[ # <![CDATA[
# #
# $Id: bash_completion,v 1.69 2002/01/24 00:41:00 ianmacd Exp $ # $Id: bash_completion,v 1.70 2002/01/24 05:03:26 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -20,7 +20,7 @@
# along with this program; if not, write to the Free Software Foundation, # along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# RELEASE: 20020121 # RELEASE: 20020124
[ -n "$DEBUG" ] && set -v || set +v [ -n "$DEBUG" ] && set -v || set +v
# Set a couple of useful vars # Set a couple of useful vars
@ -115,8 +115,7 @@ have()
} }
# GNU chown(1) completion. This should be expanded to allow the use of # GNU chown(1) completion.
# ':' as well as '.' as the user.group separator.
# #
_chown() _chown()
{ {
@ -162,6 +161,7 @@ _chgrp()
# first parameter on line or first since an option? # first parameter on line or first since an option?
if [ $COMP_CWORD = 1 ] || [[ "$prev" == -* ]]; then if [ $COMP_CWORD = 1 ] || [[ "$prev" == -* ]]; then
_expand || return 0
COMPREPLY=( $( compgen -g $cur ) ) COMPREPLY=( $( compgen -g $cur ) )
fi fi
@ -285,6 +285,8 @@ _man()
cur=${COMP_WORDS[COMP_CWORD]} cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
_expand || return 0
# default completion if parameter contains / # default completion if parameter contains /
[[ "$cur" == */* ]] && return 0 [[ "$cur" == */* ]] && return 0
# default to command completion if no man.config # default to command completion if no man.config
@ -423,6 +425,8 @@ _find()
;; ;;
esac esac
_expand || return 0
# complete using basic options ($cur has had its dash removed here, # complete using basic options ($cur has had its dash removed here,
# as otherwise compgen will bomb out with an error, since it thinks # as otherwise compgen will bomb out with an error, since it thinks
# the dash is an option to itself) # the dash is an option to itself)
@ -454,10 +458,9 @@ _find()
COMPREPLY[i]=-${COMPREPLY[i]} COMPREPLY[i]=-${COMPREPLY[i]}
done done
return 0 return 0
} }
complete -F _find -o dirnames find complete -F _find -o default find
# Linux ifconfig(8) completion # Linux ifconfig(8) completion
# #
@ -1094,6 +1097,8 @@ _scp()
COMPREPLY=() COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]} cur=${COMP_WORDS[COMP_CWORD]}
_expand || return 0
_known_hosts _known_hosts
COMPREPLY=( ${COMPREPLY[@]} $( compgen -f $cur ) ) COMPREPLY=( ${COMPREPLY[@]} $( compgen -f $cur ) )