[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-57-g9af6f35

Ville Skyttä ville.skytta at iki.fi
Mon Apr 4 21:38:39 UTC 2011


The following commit has been merged in the master branch:
commit f7c93600a6e2b0ba2586ebc74705e97c1e8d983c
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Apr 4 22:12:40 2011 +0300

    Avoid some have() calls.
    
    Single file existence etc checks are cheaper than full $PATH lookups.

diff --git a/completions/_modules b/completions/_modules
index f1ad88d..922eb89 100644
--- a/completions/_modules
+++ b/completions/_modules
@@ -19,7 +19,7 @@
 
 # Test for existence of /etc/profile.d/modules.sh too because we may end up
 # being sourced before it and thus before the `module' alias has been defined.
-have module || [ -f /etc/profile.d/modules.sh ] && {
+[ -f /etc/profile.d/modules.sh ] || have module && {
 
 _module_list ()
 {
diff --git a/completions/pkgtools b/completions/pkgtools
index 3a5df27..4b1ed19 100644
--- a/completions/pkgtools
+++ b/completions/pkgtools
@@ -1,6 +1,6 @@
 # bash completion for Slackware Linux pkgtools
 
-have removepkg && [ -f /etc/slackware-version ] &&
+[ -f /etc/slackware-version ] && have removepkg &&
 _removepkg()
 {
     local packages cur
diff --git a/completions/service b/completions/service
index 1a36f59..5e248f7 100644
--- a/completions/service
+++ b/completions/service
@@ -4,7 +4,7 @@
 # 'service' command and/or the SysV init.d directory, followed by
 # that script's available commands
 #
-{ have service || [ -d /etc/init.d/ ]; } &&
+[ -d /etc/init.d ] || have service &&
 _service()
 {
     local cur prev sysvdir

-- 
bash-completion



More information about the Bash-completion-commits mailing list