The following commit has been merged in the master branch:
commit 9ab064fb1785d828b6d93a27b9326b6ba156ecaa
Author: Igor Murzov <[email protected]>
Date:   Tue Nov 15 23:46:25 2011 +0300

    pidof: Don't check OS type (Alioth #311403)
    
    Also drop non-existent option arguments completion.
    
    Reviewed-by: Ville Skyttä <[email protected]>

diff --git a/completions/.gitignore b/completions/.gitignore
index 427fdff..9ce8b5a 100644
--- a/completions/.gitignore
+++ b/completions/.gitignore
@@ -94,7 +94,6 @@ pbzip2
 pccardctl
 perldoc
 phing
-pidof
 pigz
 pinfo
 ping6
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 1ff35ee..66f0eeb 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -210,6 +210,7 @@ bashcomp_DATA = a2x \
                passwd \
                perl \
                pgrep \
+               pidof \
                pine \
                ping \
                pkg-config \
@@ -425,7 +426,6 @@ CLEANFILES = \
        pccardctl \
        perldoc \
        phing \
-       pidof \
        pigz \
        pinfo \
        ping6 \
@@ -683,10 +683,6 @@ symlinks:
                rm -f $(targetdir)/$$file && \
                        $(LN_S) perl $(targetdir)/$$file ; \
        done
-       for file in pidof ; do \
-               rm -f $(targetdir)/$$file && \
-                       $(LN_S) pgrep $(targetdir)/$$file ; \
-       done
        for file in alpine ; do \
                rm -f $(targetdir)/$$file && \
                        $(LN_S) pine $(targetdir)/$$file ; \
diff --git a/completions/pgrep b/completions/pgrep
index 9e66fb9..87df1a1 100644
--- a/completions/pgrep
+++ b/completions/pgrep
@@ -32,7 +32,4 @@ _pgrep()
 } &&
 complete -F _pgrep pgrep
 
-# Linux pidof(8) completion.
-[[ $OSTYPE == *linux* ]] && complete -F _pgrep pidof
-
 # ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/pidof b/completions/pidof
new file mode 100644
index 0000000..12ac9a7
--- /dev/null
+++ b/completions/pidof
@@ -0,0 +1,19 @@
+# pidof(8) completion                                      -*- shell-script -*-
+
+_pidof()
+{
+    local cur prev words cword
+    _init_completion || return
+
+    case $prev in
+        -o)
+            _pids
+            return
+            ;;
+    esac
+
+    _pnames
+} &&
+complete -F _pidof pidof
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/pidof.exp b/test/completion/pidof.exp
new file mode 100644
index 0000000..c66ee9f
--- /dev/null
+++ b/test/completion/pidof.exp
@@ -0,0 +1 @@
+assert_source_completions pidof
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/pidof.exp
similarity index 80%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/pidof.exp
index 43f6272..8fdab97 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/pidof.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "abook "
+assert_complete_any "pidof "
 
 
 sync_after_int

-- 
bash-completion

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

Reply via email to