basic nslookup completion added

This commit is contained in:
ianmacd 2001-12-18 03:25:04 +00:00
parent 0cc14422d4
commit e5d7d1995f

View File

@ -2,7 +2,7 @@
#
# <![CDATA[
#
# $Id: bash_completion,v 1.34 2001/12/13 21:34:17 ianmacd Exp $
# $Id: bash_completion,v 1.35 2001/12/18 04:25:04 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
@ -251,8 +251,13 @@ _man()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
# default completion if parameter contains / or we have no man.config
[[ "$cur" == /* ]] || [ ! -f /etc/man.config ] && return 0
# default completion if parameter contains /
[[ "$cur" == /* ]] && return 0
# default to command completion if no man.config
if [ ! -f /etc/man.config ]; then
COMPREPLY=( $( compgen -c $cur ) )
return 0
fi
if [[ "$prev" == [0-9ln] ]]; then
# churn out a string of paths to search, with * appended to $cur
@ -1352,6 +1357,21 @@ _ant_targets()
}
[ "$have" ] && complete -F _ant_targets ant
have nslookup &&
_nslookup()
{
local cur
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]#-}
COMPREPLY=( $( compgen -P '-' -W 'all class= debug d2 domain= \
srchlist= defname search port= querytype= \
type= recurse retry root timeout vc \
ignoretc' $cur ) )
}
[ "$have" ] && complete -F _nslookup nslookup
# Return 1 if $1 appears to contain a redirection operator. Handles backslash
# quoting (barely).
#