diff --git a/completions/tcpdump b/completions/tcpdump index cfed6fab..bd09a10a 100644 --- a/completions/tcpdump +++ b/completions/tcpdump @@ -16,12 +16,30 @@ _tcpdump() _available_interfaces -a return 0 ;; + -m) + _filedir mib + return 0 + ;; + -T) + COMPREPLY=( $( compgen -W 'aodv cnfp rpc rtp rtcp snmp tftp vat + wb' -- "$cur" ) ) + return 0 + ;; + -z) + COMPREPLY=( $( compgen -c -- "$cur" ) ) + return 0 + ;; + -Z) + _allowed_users + return 0 + ;; + -B|-c|-C|-D|-E|-G|-M|-s|-W|-y) + return 0 + ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a -d -e -f -l -n -N -O -p \ - -q -R -S -t -u -v -x -C -F -i -m -r -s -T -w -E' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) fi } && diff --git a/test/completion/tcpdump.exp b/test/completion/tcpdump.exp new file mode 100644 index 00000000..13eb744e --- /dev/null +++ b/test/completion/tcpdump.exp @@ -0,0 +1 @@ +assert_source_completions tcpdump diff --git a/test/lib/completions/tcpdump.exp b/test/lib/completions/tcpdump.exp new file mode 100644 index 00000000..79158abf --- /dev/null +++ b/test/lib/completions/tcpdump.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "tcpdump -" + + +sync_after_int + + +teardown