diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
commit | 6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch) | |
tree | 0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /completions/nc | |
parent | Releasing progress-linux version 1:2.11-8~progress7.99u1. (diff) | |
download | bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.tar.xz bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.zip |
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/nc')
-rw-r--r-- | completions/nc | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/completions/nc b/completions/nc index 6fb0994..22e297c 100644 --- a/completions/nc +++ b/completions/nc @@ -1,9 +1,9 @@ # nc(1) completion -*- shell-script -*- -_nc() +_comp_cmd_nc() { - local cur prev words cword - _init_completion -n : || return + local cur prev words cword comp_args + _comp_initialize -n : -- "$@" || return case $prev in -*[hIiMmOPpqVWw]) @@ -11,41 +11,39 @@ _nc() ;; -*s) if [[ ${words[*]} == *-6* ]]; then - _ip_addresses -6 - __ltrim_colon_completions "$cur" + _comp_compgen_ip_addresses -6 else - _ip_addresses + _comp_compgen_ip_addresses fi return ;; -*T) - COMPREPLY=($(compgen -W 'critical inetcontrol lowcost lowdelay - netcontrol throughput reliability ef af{11..43} cs{0..7}' \ - -- "$cur")) + _comp_compgen -- -W 'critical inetcontrol lowcost lowdelay + netcontrol throughput reliability ef af{11..43} cs{0..7}' return ;; -*X) - COMPREPLY=($(compgen -W '4 5 connect' -- "$cur")) + _comp_compgen -- -W '4 5 connect' return ;; -*x) - _known_hosts_real -- "$cur" + _comp_compgen_known_hosts -- "$cur" return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) + _comp_compgen_help -- -h return fi # Complete 1st non-option arg only - local args - _count_args "" "-*[IiMmOPpqsTVWwXx]" - ((args == 1)) || return + local REPLY + _comp_count_args -n "" -a "-*[IiMmOPpqsTVWwXx]" + ((REPLY == 1)) || return - _known_hosts_real -- "$cur" + _comp_compgen_known_hosts -- "$cur" } && - complete -F _nc nc + complete -F _comp_cmd_nc nc # ex: filetype=sh |