summaryrefslogtreecommitdiffstats
path: root/completions/nmap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
commit6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch)
tree0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /completions/nmap
parentReleasing progress-linux version 1:2.11-8~progress7.99u1. (diff)
downloadbash-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/nmap')
-rw-r--r--completions/nmap25
1 files changed, 12 insertions, 13 deletions
diff --git a/completions/nmap b/completions/nmap
index 482148e..a3e691b 100644
--- a/completions/nmap
+++ b/completions/nmap
@@ -1,30 +1,30 @@
# bash completion for nmap -*- shell-script -*-
-_nmap()
+_comp_cmd_nmap()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -- "$@" || return
case $prev in
-iL | -oN | -oX | -oS | -oG | ---excludefile | --resume | --stylesheet)
- _filedir
+ _comp_compgen_filedir
return
;;
-oA | --datadir)
- _filedir -d
+ _comp_compgen_filedir -d
return
;;
-e)
- _available_interfaces -a
+ _comp_compgen_available_interfaces -a
return
;;
-b | --dns-servers)
- _known_hosts_real -- "$cur"
+ _comp_compgen_known_hosts -- "$cur"
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
if [[ $cur == -* ]]; then
# strip everything following a :, inclusive
@@ -35,7 +35,7 @@ _nmap()
# expand --foo/bar to --foo --bar
# strip everything following a non-option name or = char
# TODO: should expand -T<0-5> to -T0 ... -T5
- COMPREPLY=($(compgen -W "$(
+ _comp_compgen_split -- "$(
"$1" --help 2>&1 | command sed \
-e "s/:.*$//" \
-e "s/=.*$/=/" \
@@ -44,13 +44,12 @@ _nmap()
-e "/^[[:space:]]*-[^-]/s/\/\([^-]\)/ -\1/g" \
-e "/^[[:space:]]*--/s/\/\([^-]\)/ --\1/g" \
-e "s/[^[:space:]a-zA-Z0-9=-].*$//"
- )" \
- -- "$cur"))
+ )"
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
else
- _known_hosts_real -- "$cur"
+ _comp_compgen_known_hosts -- "$cur"
fi
} &&
- complete -F _nmap nmap
+ complete -F _comp_cmd_nmap nmap
# ex: filetype=sh