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

David Paleino d.paleino at gmail.com
Sat Jun 20 07:15:37 UTC 2009


The following commit has been merged in the master branch:
commit 1e532f0f2b87a07277c39ed3f68ea134d0393c4d
Author: David Paleino <d.paleino at gmail.com>
Date:   Sat Jun 20 09:14:08 2009 +0200

    Check whether avahi-daemon is started

diff --git a/bash_completion b/bash_completion
index 20e3b49..bdf01a3 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1193,10 +1193,13 @@ _known_hosts_real()
 	    fi
 
         # Add hosts reported by avahi, if it's available
+        # and if the daemon is started.
         if type avahi-browse >&/dev/null; then
-        COMPREPLY=( "${COMPREPLY[@]}" $(
-            compgen -W "$( avahi-browse -kcpr _workstation._tcp | \
-                           grep ^= | cut -d\; -f7 | sort -u )" -- $cur ) )
+            if [ -z "$(pidof avahi-daemon)" ]; then
+                COMPREPLY=( "${COMPREPLY[@]}" $(
+                    compgen -W "$( avahi-browse -kcpr _workstation._tcp | \
+                                   grep ^= | cut -d\; -f7 | sort -u )" -- $cur ) )
+            fi
         fi
 
 	    # Now add results of normal hostname completion

-- 
bash-completion



More information about the Bash-completion-commits mailing list