From e28d19ef4c413d850dd5a80e2ea3907f50608d70 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Mon, 19 Apr 2010 19:59:47 +0200 Subject: [PATCH] initial import --- Makefile.am | 1 + contrib/nmap | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 contrib/nmap diff --git a/Makefile.am b/Makefile.am index eb1106c4..609ef8c1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -91,6 +91,7 @@ bashcomp_DATA = contrib/abook \ contrib/mysqladmin \ contrib/ncftp \ contrib/net-tools \ + contrib/nmap \ contrib/ntpdate \ contrib/openldap \ contrib/openssl \ diff --git a/contrib/nmap b/contrib/nmap new file mode 100644 index 00000000..19f0a07e --- /dev/null +++ b/contrib/nmap @@ -0,0 +1,60 @@ +# bash completion for nmap + +have nmap && +_nmap() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=`_get_pword` + + case $prev in + -iL|-oN|-oX|-oS|-oG|---excludefile|--resume|--stylesheet) + _filedir + return 0 + ;; + -oA|--datadir) + _filedir -d + return 0 + ;; + -e) + _available_interfaces + return 0 + ;; + -b|--dns-servers) + _known_hosts_real "$cur" + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-iL -iR --exclude --excludefile -sL -sP \ + -PN -PS -PA -PU -PY -PE -PP -PM -PO -n -R --dns-servers \ + --system-dns --traceroute -sS -sT -sA -sW -sM -sU -sN -sF -sX \ + --scanflags -sI -sY -sZ -sO -b -p -F -r --top-ports --port-ratio \ + -sV --version-intensity --version-light --version-all \ + --version-trace -sC --script= --script-args= --script-trace \ + --script-updatedb -O --osscan-limit --osscan-guess -T0 -T1 -T2 -T3 \ + -T4 -T5 --min-hostgroup --max-hostgroup --min-parallelism \ + --max-parallelism --min-rtt-timeout --max-rtt-timeout \ + --initial-rtt-timeout --max-retries --host-timeout --scan-delay \ + --max-scan-delay --min-rate --max-rate -f --mtu -D -S -e \ + --source-port --data-length --ip-options --ttl --spoof-mac \ + --badsum --adler32 -oN -oX -oS -oG -oA -v -d --reason --open \ + --packet-trace --iflist --log-errors --append-output --resume \ + --stylesheet --webxml --no-stylesheet -6 -A --datadir --send-eth \ + --send-ip --privilege--unprivileged -V -h' -- "$cur" ) ) + else + _known_hosts_real "$cur" + fi +} && +complete -F _nmap nmap + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh