[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-271-g5a6b9a2
Ville Skyttä
ville.skytta at iki.fi
Wed May 4 21:20:32 UTC 2011
The following commit has been merged in the master branch:
commit ae9e14094831c506b2cd64d85eb9f92a62453ec6
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Thu May 5 00:18:18 2011 +0300
tcpdump: Use _parse_usage, add bunch of option completions and a basic test case.
diff --git a/completions/tcpdump b/completions/tcpdump
index cfed6fa..bd09a10 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 0000000..13eb744
--- /dev/null
+++ b/test/completion/tcpdump.exp
@@ -0,0 +1 @@
+assert_source_completions tcpdump
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/tcpdump.exp
similarity index 78%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/tcpdump.exp
index 77cd07f..79158ab 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/tcpdump.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "a2ps "
+assert_complete_any "tcpdump -"
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list