From e5d7d1995fed4077885ea0c21d20449b8ef443dc Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Tue, 18 Dec 2001 03:25:04 +0000 Subject: [PATCH] basic nslookup completion added --- bash_completion | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/bash_completion b/bash_completion index e4a1c66a..26150c1f 100644 --- a/bash_completion +++ b/bash_completion @@ -2,7 +2,7 @@ # # # @@ -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). #