[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-505-g333a5a5

Ville Skyttä ville.skytta at iki.fi
Fri Nov 4 22:54:47 UTC 2011


The following commit has been merged in the master branch:
commit b54d3f022f73553bdec64e1da29736d41835a029
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Nov 5 00:38:37 2011 +0200

    _known_hosts_real: Discard @markers at beginning of line.

diff --git a/bash_completion b/bash_completion
index 637ca69..8c8fab5 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1414,8 +1414,10 @@ _known_hosts_real()
         if [ ${#kh[@]} -gt 0 ]; then
             # FS needs to look for a comma separated list
             COMPREPLY+=( $( awk 'BEGIN {FS=","}
-            /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \
-            sub(" .*$", "", $i); \
+            /^\s*[^|\#]/ {
+            sub("^@[^ ]+ +", ""); \
+            sub(" .*$", ""); \
+            for (i=1; i<=2; ++i) { \
             sub("^\\[", "", $i); sub("\\](:[0-9]+)?$", "", $i); \
             if ($i ~ /'"$awkcur"'/) {print $i} \
             }}' "${kh[@]}" 2>/dev/null ) )
diff --git a/test/fixtures/_known_hosts_real/known_hosts b/test/fixtures/_known_hosts_real/known_hosts
index f655eaa..0d6f502 100644
--- a/test/fixtures/_known_hosts_real/known_hosts
+++ b/test/fixtures/_known_hosts_real/known_hosts
@@ -3,7 +3,7 @@
 doo
 ike ssh-rsa qwerty1234/Qwerty+1234==
 jub,10.0.0.1
-kyl,100.0.0.2
+ at cert-authority  kyl,100.0.0.2 xxxfoo
 [10.10.0.3]:10022
 [blah]:1234
 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555

-- 
bash-completion



More information about the Bash-completion-commits mailing list