summaryrefslogtreecommitdiffstats
path: root/completions/nc
diff options
context:
space:
mode:
Diffstat (limited to 'completions/nc')
-rw-r--r--completions/nc32
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