[Bash-completion-commits] [SCM] bash-completion branch, master, updated. f0cc5fc2a8642c0acc925c31a0fd81e05f68f62a
Ville Skyttä
ville.skytta at iki.fi
Thu Oct 7 15:04:04 UTC 2010
The following commit has been merged in the master branch:
commit f0cc5fc2a8642c0acc925c31a0fd81e05f68f62a
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Thu Oct 7 18:03:59 2010 +0300
Add ether-wake completion.
diff --git a/CHANGES b/CHANGES
index d2269f4..a127231 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,8 +8,9 @@ bash-completion (2.x)
[ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3.
- * Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, filefrag,
- iftop, lrzip, POSIX sh, sysbench, tune2fs, xmodmap, and xrdb completions.
+ * Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, ether-wake,
+ filefrag, iftop, lrzip, POSIX sh, sysbench, tune2fs, xmodmap, and xrdb
+ completions.
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions.
diff --git a/completions/net-tools b/completions/net-tools
index 5b86a64..e7de2b0 100644
--- a/completions/net-tools
+++ b/completions/net-tools
@@ -96,6 +96,32 @@ _route()
} &&
complete -F _route route
+have ether-wake &&
+_ether_wake()
+{
+ COMPREPLY=()
+ local cur prev
+ _get_comp_words_by_ref -n : cur prev
+
+ case $prev in
+ -i)
+ _available_interfaces
+ return 0
+ ;;
+ -p)
+ return 0
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '-b -D -i -p -V' -- "$cur" ) )
+ return 0
+ fi
+
+ _mac_addresses
+} &&
+complete -F _ether_wake ether-wake
+
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/test/completion/ether-wake.exp b/test/completion/ether-wake.exp
new file mode 100644
index 0000000..602ba27
--- /dev/null
+++ b/test/completion/ether-wake.exp
@@ -0,0 +1 @@
+assert_source_completions ether-wake
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/ether-wake.exp
similarity index 77%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/ether-wake.exp
index 43f6272..fe1aa17 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/ether-wake.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "abook "
+assert_complete_any "ether-wake "
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list