summaryrefslogtreecommitdiffstats
path: root/completions/ipv6calc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf2621414ee5f2f601424c22f00e207903e3b6104 (patch)
tree56a856dafd1ca684bb23263cacaa723ee4f404fc /completions/ipv6calc
parentAdding debian version 1:2.11-8. (diff)
downloadbash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz
bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.zip
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/ipv6calc')
-rw-r--r--completions/ipv6calc27
1 files changed, 14 insertions, 13 deletions
diff --git a/completions/ipv6calc b/completions/ipv6calc
index c452c15..7cf7d82 100644
--- a/completions/ipv6calc
+++ b/completions/ipv6calc
@@ -1,23 +1,24 @@
# ipv6calc completion -*- shell-script -*-
-_ipv6calc()
+_comp_cmd_ipv6calc()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -- "$@" || return
+ local noargopts='!(-*|*[dIOA]*)'
+ # shellcheck disable=SC2254
case "$prev" in
- --debug | -!(-*)d)
+ --debug | -${noargopts}d)
return
;;
- --in | --out | --action | -!(-*)[IOA])
+ --in | --out | --action | -${noargopts}[IOA])
# With ipv6calc < 0.73.0, -m does nothing here, so use sed instead.
- COMPREPLY=($(compgen -W "$($1 "$prev" -h 2>&1 |
- command sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p')" \
- -- "$cur"))
+ _comp_compgen_split -- "$("$1" "$prev" -h 2>&1 |
+ command sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p')"
return
;;
--db-geoip | --db-ip2location-ipv4 | --db-ip2location-ipv6)
- _filedir
+ _comp_compgen_filedir
return
;;
--printstart | --printend)
@@ -25,14 +26,14 @@ _ipv6calc()
;;
esac
- $split && return
+ [[ $was_split ]] && return
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '$("$1" -h 2>&1 |
- command sed -e "s/[][]//g" | _parse_help -)' -- "$cur"))
+ _comp_compgen_help - <<<"$("$1" -h 2>&1 |
+ command sed -e "s/[][]//g")"
fi
} &&
- complete -F _ipv6calc ipv6calc
+ complete -F _comp_cmd_ipv6calc ipv6calc
# ex: filetype=sh