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

Ville Skyttä ville.skytta at iki.fi
Fri Jun 12 17:27:02 UTC 2009


The following commit has been merged in the master branch:
commit 2c882c3cfe67755f563cac36a419b0e33255f276
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Jun 12 20:14:52 2009 +0300

    Use compgen -W instead of grepping $cur in heimdal.

diff --git a/contrib/heimdal b/contrib/heimdal
index f22a586..565af78 100644
--- a/contrib/heimdal
+++ b/contrib/heimdal
@@ -7,15 +7,15 @@ have ktutil && {
 _heimdal_principals()
 {
 
-	COMPREPLY=( $( kadmin -l dump 2>/dev/null | awk '{print $1}' | \
-		grep "^$cur" ) )
+	COMPREPLY=( $( compgen -W "$( kadmin -l dump 2>/dev/null | \
+		awk '{print $1}' )" -- $cur ) )
 }
 
 _heimdal_realms()
 {
 
-	COMPREPLY=( $( kadmin -l dump 2>/dev/null | awk '{print $1}' | \
-		awk -F @ '{print $2}' | grep "^$cur" ) )
+	COMPREPLY=( $( compgen -W "( kadmin -l dump 2>/dev/null | \
+		awk '{print $1}' | awk -F @ '{print $2}' )" -- $cur ) )
 }
 
 _heimdal_encodings()

-- 
bash-completion



More information about the Bash-completion-commits mailing list