File tree Expand file tree Collapse file tree 5 files changed +4
-4
lines changed Expand file tree Collapse file tree 5 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1506,6 +1506,8 @@ _configured_interfaces()
1506
1506
}
1507
1507
1508
1508
# Local IP addresses.
1509
+ # If producing IPv6 completions, `_comp_initialize` with `-n :`.
1510
+ #
1509
1511
# -4: IPv4 addresses only (default)
1510
1512
# -6: IPv6 addresses only
1511
1513
# -a: All addresses
@@ -1526,6 +1528,7 @@ _ip_addresses()
1526
1528
command sed -e ' s/[[:space:]]addr:/ /' -ne \
1527
1529
" s|.*inet${n} [[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p" )
1528
1530
_comp_compgen -a -- -W " $addrs "
1531
+ [[ ! $n ]] || _comp_ltrim_colon_completions " $cur "
1529
1532
}
1530
1533
1531
1534
# This function completes on available kernels
Original file line number Diff line number Diff line change 3
3
_comp_cmd_curl ()
4
4
{
5
5
local cur prev words cword comp_args
6
- _comp_initialize -- " $@ " || return
6
+ _comp_initialize -n : - - " $@ " || return
7
7
8
8
local noargopts=' !(-*|*[KbcDoTCFmQreYytzuAwEdHPxX]*)'
9
9
# shellcheck disable=SC2254
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ _comp_cmd_iperf()
37
37
--bind | -${noargopts} B)
38
38
_available_interfaces -a
39
39
_ip_addresses -a
40
- _comp_ltrim_colon_completions " $cur "
41
40
return
42
41
;;
43
42
--bind-dev)
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ _comp_cmd_links()
47
47
;;
48
48
-bind-address-ipv6)
49
49
_ip_addresses -6
50
- _comp_ltrim_colon_completions " $cur "
51
50
return
52
51
;;
53
52
-async-dns | -download-utime | -aggressive-cache | -only-proxies | \
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ _comp_cmd_nc()
12
12
-* s)
13
13
if [[ ${words[*]} == * -6* ]]; then
14
14
_ip_addresses -6
15
- _comp_ltrim_colon_completions " $cur "
16
15
else
17
16
_ip_addresses
18
17
fi
You can’t perform that action at this time.
0 commit comments