Skip to content

Commit 812e2ac

Browse files
committed
_known_hosts_real: exclude Host negations
1 parent d128d70 commit 812e2ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ _known_hosts_real()
17521752
local -a hosts=($(command sed -ne 's/^[[:blank:]]*[Hh][Oo][Ss][Tt][[:blank:]]\(.*\)$/\1/p' "${config[@]}"))
17531753
if ((${#hosts[@]} != 0)); then
17541754
COMPREPLY+=($(compgen -P "$prefix" \
1755-
-S "$suffix" -W '${hosts[@]%%[*?%]*}' -- "$cur"))
1755+
-S "$suffix" -W '${hosts[@]%%[*?%]*}' -X '\!*' -- "$cur"))
17561756
fi
17571757
fi
17581758

test/fixtures/_known_hosts_real/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
Host gee* jar?this-part-we-do-not-complete-at-least-yet
55
HostName %h.example.com
66
# Indented
7-
Host hus%%eth0 #not-a-comment
7+
Host hus%%eth0 !negated #not-a-comment

0 commit comments

Comments
 (0)