More known hosts IPv6 completion fixes, thanks to Yoshinori KUNIGA.
https://bugzilla.redhat.com/show_bug.cgi?id=630658#c4
This commit is contained in:
parent
3d8efed618
commit
1da64f602a
3
CHANGES
3
CHANGES
@ -22,8 +22,7 @@ bash-completion (2.x)
|
||||
* Drop bad kompare filename completion (Alioth: #312708).
|
||||
* Make _filedir and _filedir_xspec complete uppercase versions of their
|
||||
filename extension arguments in addition to exact case matches.
|
||||
* Fix known hosts completion for IPv6 addresses whose last 16 bits are digits
|
||||
(Alioth: #312695, RedHat: #630658).
|
||||
* IPv6 known hosts completion fixes (Alioth: #312695, RedHat: #630658).
|
||||
* Improve mplayer and mencoder completions.
|
||||
* Fixes to completions for filenames containing tabs (RedHat: #629518).
|
||||
|
||||
|
@ -1279,16 +1279,16 @@ _known_hosts_real()
|
||||
awkcur=${awkcur//\./\\\.}
|
||||
curd=$awkcur
|
||||
|
||||
if [[ "$awkcur" == [0-9]*.* ]]; then
|
||||
# Digits followed by a dot - just search for that
|
||||
awkcur="^$awkcur.*"
|
||||
if [[ "$awkcur" == [0-9]*[.:]* ]]; then
|
||||
# Digits followed by a dot or a colon - just search for that
|
||||
awkcur="^$awkcur[.:]*"
|
||||
elif [[ "$awkcur" == [0-9]* ]]; then
|
||||
# Digits followed by no dot - search for digits followed
|
||||
# by a dot
|
||||
awkcur="^$awkcur.*\."
|
||||
# Digits followed by no dot or colon - search for digits followed
|
||||
# by a dot or a colon
|
||||
awkcur="^$awkcur.*[.:]"
|
||||
elif [ -z "$awkcur" ]; then
|
||||
# A blank - search for a dot or an alpha character
|
||||
awkcur="[a-z.]"
|
||||
# A blank - search for a dot, a colon, or an alpha character
|
||||
awkcur="[a-z.:]"
|
||||
else
|
||||
awkcur="^$awkcur"
|
||||
fi
|
||||
|
3
test/fixtures/_known_hosts_real/known_hosts
vendored
3
test/fixtures/_known_hosts_real/known_hosts
vendored
@ -8,3 +8,6 @@ kyl,100.0.0.2
|
||||
[blah]:1234
|
||||
fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555
|
||||
fe80::123:0xff:dead:beef%eth0
|
||||
1111:2222:3333:4444:5555:6666:xxxx:abab
|
||||
11xx:2222:3333:4444:5555:6666:xxxx:abab
|
||||
::42
|
||||
|
@ -17,8 +17,8 @@ setup
|
||||
set test "Hosts should be put in COMPREPLY"
|
||||
set hosts [get_hosts]
|
||||
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
|
||||
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 and fe80::123:0xff:dead:beef%eth0 in ./fixtures/_known_hosts_real/known_hosts
|
||||
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0
|
||||
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 test cases in ./fixtures/_known_hosts_real/known_hosts
|
||||
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42
|
||||
set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY}
|
||||
assert_bash_list $hosts $cmd $test
|
||||
|
||||
@ -29,8 +29,8 @@ sync_after_int
|
||||
set test "Hosts should have username prefix and colon suffix"
|
||||
set hosts [get_hosts]
|
||||
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
|
||||
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 and fe80::123:0xff:dead:beef%eth0 in ./fixtures/_known_hosts_real/known_hosts
|
||||
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0
|
||||
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 test cases in ./fixtures/_known_hosts_real/known_hosts
|
||||
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42
|
||||
set hosts [lsort -ascii $hosts]
|
||||
set expected {}
|
||||
foreach host $hosts {
|
||||
@ -103,8 +103,8 @@ set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE"
|
||||
assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE="
|
||||
set hosts [get_hosts_avahi]
|
||||
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
|
||||
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 and fe80::123:0xff:dead:beef%eth0 in ./fixtures/_known_hosts_real/known_hosts
|
||||
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0
|
||||
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 test cases in ./fixtures/_known_hosts_real/known_hosts
|
||||
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42
|
||||
# Call _known_hosts
|
||||
set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY}
|
||||
assert_bash_list $hosts $cmd $test
|
||||
|
Loading…
x
Reference in New Issue
Block a user