[Bash-completion-commits] [SCM] bash-completion branch, master, updated. efaae3f8b958b14dd6fa5b7f07ea13375ddc3737

Ville Skyttä ville.skytta at iki.fi
Wed Jun 9 20:15:44 UTC 2010


The following commit has been merged in the master branch:
commit 887361302bb8e41548db1fc2dfe1cfab466e6043
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Jun 9 22:50:33 2010 +0300

    Split ipsec completion into contrib/ipsec.

diff --git a/CHANGES b/CHANGES
index 670f19d..639e145 100644
--- a/CHANGES
+++ b/CHANGES
@@ -60,6 +60,7 @@ bash-completion (2.x)
   * Split chown, chgrp, and id completions into contrib/coreutils.
   * Split kill, look, and renice completions into contrib/util-linux.
   * Split killall, pkill, pgrep and related completions into contrib/procps.
+  * Split ipsec completion into contrib/ipsec.
   * Do basic HTML file completion with Firefox and Chrome and friends,
     and Epiphany.
   * Do basic diff/patch completion with cdiff and kompare.
diff --git a/Makefile.am b/Makefile.am
index 03c4ace..c778054 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,6 +59,7 @@ bashcomp_DATA = contrib/abook \
 		contrib/info \
 		contrib/iptables \
 		contrib/ipmitool \
+		contrib/ipsec \
 		contrib/ipv6calc \
 		contrib/isql \
 		contrib/jar \
diff --git a/bash_completion b/bash_completion
index b2b8fc8..e178e0f 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1102,50 +1102,6 @@ _ifupdown()
 complete -F _ifupdown ifup ifdown
 [ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus
 
-# Linux ipsec(8) completion (for FreeS/WAN)
-#
-[ $UNAME = Linux ] && have ipsec &&
-_ipsec()
-{
-    local cur
-
-    COMPREPLY=()
-    cur=`_get_cword`
-
-
-    if [ $COMP_CWORD -eq 1 ]; then
-        COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \
-            pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \
-            tncfg whack' -- "$cur" ) )
-        return 0
-    fi
-
-    case ${COMP_WORDS[1]} in
-        auto)
-            COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \
-                --replace --down --route --unroute \
-                --ready --status --rereadsecrets' \
-                -- "$cur" ) )
-            ;;
-        manual)
-            COMPREPLY=( $( compgen -W '--up --down --route --unroute \
-                --union' -- "$cur" ) )
-            ;;
-        ranbits)
-            COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \
-                -- "$cur" ) )
-            ;;
-        setup)
-            COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) )
-            ;;
-        *)
-            ;;
-    esac
-
-    return 0
-} &&
-complete -F _ipsec ipsec
-
 # This function provides simple user at host completion
 #
 _user_at_host() {
diff --git a/contrib/ipsec b/contrib/ipsec
new file mode 100644
index 0000000..86da498
--- /dev/null
+++ b/contrib/ipsec
@@ -0,0 +1,51 @@
+# Linux ipsec(8) completion (for FreeS/WAN)
+#
+[ $UNAME = Linux ] && have ipsec &&
+_ipsec()
+{
+    local cur
+
+    COMPREPLY=()
+    cur=`_get_cword`
+
+
+    if [ $COMP_CWORD -eq 1 ]; then
+        COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \
+            pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \
+            tncfg whack' -- "$cur" ) )
+        return 0
+    fi
+
+    case ${COMP_WORDS[1]} in
+        auto)
+            COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \
+                --replace --down --route --unroute \
+                --ready --status --rereadsecrets' \
+                -- "$cur" ) )
+            ;;
+        manual)
+            COMPREPLY=( $( compgen -W '--up --down --route --unroute \
+                --union' -- "$cur" ) )
+            ;;
+        ranbits)
+            COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \
+                -- "$cur" ) )
+            ;;
+        setup)
+            COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) )
+            ;;
+        *)
+            ;;
+    esac
+
+    return 0
+} &&
+complete -F _ipsec ipsec
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/ipsec.exp b/test/completion/ipsec.exp
new file mode 100644
index 0000000..f904429
--- /dev/null
+++ b/test/completion/ipsec.exp
@@ -0,0 +1 @@
+assert_source_completions ipsec
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/ipsec.exp
similarity index 83%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/ipsec.exp
index 3f4e301..15617a1 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/ipsec.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "abook "
+assert_complete_any "ipsec "
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list