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

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


The following commit has been merged in the master branch:
commit 3f1f6120d7e54da26ea0c421adf90ec60b1ac527
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Jun 9 22:47:42 2010 +0300

    Split killall, pkill, pgrep and related completions into contrib/procps.

diff --git a/CHANGES b/CHANGES
index 1c76d6a..670f19d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -59,6 +59,7 @@ bash-completion (2.x)
   * Split service completion into contrib/service.
   * 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.
   * 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 645df14..03c4ace 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -110,6 +110,7 @@ bashcomp_DATA = contrib/abook \
 		contrib/postfix \
 		contrib/postgresql \
 		contrib/povray \
+		contrib/procps \
 		contrib/python \
 		contrib/qdbus \
 		contrib/qemu \
diff --git a/bash_completion b/bash_completion
index 4d89fc9..b2b8fc8 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1081,45 +1081,6 @@ _dvd_devices()
 [ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list extract \
     patch configure build install reinstall deinstall clean clean-depends \
     kernel buildworld' make
-# killall(1) (Linux and FreeBSD) and pkill(1) completion.
-#
-[[ $UNAME == Linux || $UNAME == FreeBSD ]] || have pkill &&
-_killall()
-{
-    local cur
-
-    COMPREPLY=()
-    cur=`_get_cword`
-
-    if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then
-        _signals
-    else
-        _pnames
-    fi
-
-    return 0
-}
-[[ $UNAME == Linux || $UNAME == FreeBSD ]] && complete -F _killall killall
-have pkill && complete -F _killall pkill
-
-# pgrep(1) completion.
-#
-[ $UNAME = Linux ] || have pgrep &&
-_pgrep()
-{
-    local cur
-
-    COMPREPLY=()
-    cur=`_get_cword`
-
-    _pnames
-
-    return 0
-}
-have pgrep && complete -F _pgrep pgrep
-
-# Linux pidof(8) completion.
-[ $UNAME = Linux ] && complete -F _pgrep pidof
 
 # Red Hat & Debian GNU/Linux if{up,down} completion
 #
diff --git a/contrib/procps b/contrib/procps
new file mode 100644
index 0000000..4a141f2
--- /dev/null
+++ b/contrib/procps
@@ -0,0 +1,49 @@
+# Completions for tools included in procps and related
+
+# killall(1) (Linux and FreeBSD) and pkill(1) completion.
+#
+[[ $UNAME == Linux || $UNAME == FreeBSD ]] || have pkill &&
+_killall()
+{
+    local cur
+
+    COMPREPLY=()
+    cur=`_get_cword`
+
+    if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then
+        _signals
+    else
+        _pnames
+    fi
+
+    return 0
+}
+[[ $UNAME == Linux || $UNAME == FreeBSD ]] && complete -F _killall killall
+have pkill && complete -F _killall pkill
+
+# pgrep(1) completion.
+#
+[ $UNAME = Linux ] || have pgrep &&
+_pgrep()
+{
+    local cur
+
+    COMPREPLY=()
+    cur=`_get_cword`
+
+    _pnames
+
+    return 0
+}
+have pgrep && complete -F _pgrep pgrep
+
+# Linux pidof(8) completion.
+[ $UNAME = Linux ] && complete -F _pgrep pidof
+
+# 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/pgrep.exp b/test/completion/pgrep.exp
new file mode 100644
index 0000000..6deac16
--- /dev/null
+++ b/test/completion/pgrep.exp
@@ -0,0 +1 @@
+assert_source_completions pgrep
diff --git a/test/completion/pkill.exp b/test/completion/pkill.exp
new file mode 100644
index 0000000..56e3083
--- /dev/null
+++ b/test/completion/pkill.exp
@@ -0,0 +1 @@
+assert_source_completions pkill
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/pgrep.exp
similarity index 83%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/pgrep.exp
index 3f4e301..63143ac 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/pgrep.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "abook "
+assert_complete_any "pgrep "
 
 
 sync_after_int
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/pkill.exp
similarity index 83%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/pkill.exp
index 3f4e301..0333fc9 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/pkill.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "abook "
+assert_complete_any "pkill "
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list