[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-69-g7c34b56

Ville Skyttä ville.skytta at iki.fi
Tue Apr 12 17:29:32 UTC 2011


The following commit has been merged in the master branch:
commit c42aa0b4243ef03ec709e68b9874d2334c7206bf
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Apr 12 20:10:09 2011 +0300

    Install only full path (no basename) completions for /etc/init.d/*.

diff --git a/CHANGES b/CHANGES
index d35144a..189eaf9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,7 @@ bash-completion (2.x)
   * Split rpm and rpmbuild completions and improve them both.
   * Add $_backup_glob for matching various backup files.
   * Load and general speedups.
+  * Install only full path (no basename) completions for /etc/init.d/*.
 
   [ Guillaume Rousse ]
   * added puppet completion, using work from Mathieu Parent (sathieudebian.org)
diff --git a/completions/service b/completions/service
index d49a668..a912f55 100644
--- a/completions/service
+++ b/completions/service
@@ -13,10 +13,6 @@ _service()
     COMPREPLY=()
     _get_comp_words_by_ref cur prev
 
-    # don't complete for things like killall, ssh and mysql if it's
-    # the standalone command, rather than the init script
-    [[ ${COMP_WORDS[0]} != @(*init.d/!(functions|~)|service) ]] && return 0
-
     # don't complete past 2nd token
     [ $COMP_CWORD -gt 2 ] && return 0
 
@@ -34,8 +30,7 @@ _service()
 } &&
 complete -F _service service
 for svc in /etc/init.d/*; do
-    [ ! -x "$svc" ] || complete -p "${svc##*/}" &>/dev/null || \
-        complete -F _service -o default "${svc##*/}"
+    [ -x "$svc" ] && complete -F _service $svc
 done
 unset svc
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list