The following commit has been merged in the master branch:
commit 50df6e0aefd8f6f4c6d823bd45989f7e0f81b9e7
Author: Guillaume Rousse <[email protected]>
Date:   Wed May 27 18:58:31 2009 +0200

    split tcpdump completion

diff --git a/Makefile.am b/Makefile.am
index 719f219..75cfb10 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,6 +96,7 @@ bashcomp_DATA = contrib/ant \
                contrib/svk \
                contrib/sysctl \
                contrib/tar \
+               contrib/tcpdump \
                contrib/unace \
                contrib/unrar \
                contrib/update-alternatives \
diff --git a/bash_completion b/bash_completion
index 4171c19..6dd5bdf 100644
--- a/bash_completion
+++ b/bash_completion
@@ -2610,38 +2610,6 @@ _jar()
 } &&
 complete -F _jar $filenames jar
 
-# tcpdump(8) completion
-#
-have tcpdump &&
-_tcpdump()
-{
-       local cur prev
-
-       COMPREPLY=()
-       cur=`_get_cword`
-       prev=${COMP_WORDS[COMP_CWORD-1]}
-
-       case "$prev" in
-               -@(r|w|F))
-                       _filedir
-                       return 0
-                       ;;
-               -i)
-                       _available_interfaces -a
-                       return 0
-                       ;;
-       esac
-
-
-       if [[ "$cur" == -* ]]; then
-               COMPREPLY=( $( compgen -W '-a -d -e -f -l -n -N -O -p \
-                       -q -R -S -t -u -v -x -C -F -i -m -r -s -T -w \
-                       -E' -- $cur ) )
-       fi
-
-} &&
-complete -F _tcpdump tcpdump
-
 # autorpm(8) completion
 #
 have autorpm &&
diff --git a/contrib/dhclient b/contrib/tcpdump
similarity index 53%
copy from contrib/dhclient
copy to contrib/tcpdump
index 0b466d7..bc867fd 100644
--- a/contrib/dhclient
+++ b/contrib/tcpdump
@@ -1,9 +1,10 @@
 # -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
 # ex: ts=8 sw=8 noet filetype=sh
 #
-# bash completion for dhclient
+# bash completion for tcpdump
 
-have dhclient && _dhclient()
+have tcpdump &&
+_tcpdump()
 {
        local cur prev
 
@@ -12,21 +13,22 @@ have dhclient && _dhclient()
        prev=${COMP_WORDS[COMP_CWORD-1]}
 
        case "$prev" in
-               -@(cf|lf|pf|sf))
+               -@(r|w|F))
                        _filedir
                        return 0
                        ;;
-               -s)
-                       _known_hosts
+               -i)
+                       _available_interfaces -a
                        return 0
                        ;;
        esac
 
+
        if [[ "$cur" == -* ]]; then
-               COMPREPLY=( $( compgen -W '-p -d -q -1 -r -lf -pf \
-                       -cf -sf -s -g -n -nw -w' -- $cur ) )
-       else
-               _available_interfaces
+               COMPREPLY=( $( compgen -W '-a -d -e -f -l -n -N -O -p \
+                       -q -R -S -t -u -v -x -C -F -i -m -r -s -T -w \
+                       -E' -- $cur ) )
        fi
+
 } &&
-complete -F _dhclient dhclient
+complete -F _tcpdump tcpdump

-- 
bash-completion

_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-commits

Reply via email to