[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-158-g3d7102b
Ville Skyttä
ville.skytta at iki.fi
Wed Apr 4 19:55:45 UTC 2012
The following commit has been merged in the master branch:
commit 3d7102b9a5b138091122bad601cc3c104df0ce8f
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Wed Apr 4 22:54:30 2012 +0300
hwclock: New completion.
diff --git a/completions/Makefile.am b/completions/Makefile.am
index fabe1c2..0a24d0c 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -119,6 +119,7 @@ bashcomp_DATA = a2x \
hping2 \
htop \
htpasswd \
+ hwclock \
iconv \
id \
idn \
diff --git a/completions/hwclock b/completions/hwclock
new file mode 100644
index 0000000..e9d77aa
--- /dev/null
+++ b/completions/hwclock
@@ -0,0 +1,23 @@
+# hwclock(8) completion -*- shell-script -*-
+
+_hwclock()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -h|--help|-V|--version|--date|--epoch)
+ return
+ ;;
+ -f|--rtc|--adjfile)
+ _filedir
+ ;;
+ esac
+
+ [[ $cur == -* ]] && \
+ COMPREPLY=( $( PATH="$PATH:/sbin"
+ compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+} &&
+complete -F _hwclock hwclock
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/hwclock.exp b/test/completion/hwclock.exp
new file mode 100644
index 0000000..b0bdb8e
--- /dev/null
+++ b/test/completion/hwclock.exp
@@ -0,0 +1 @@
+assert_source_completions hwclock
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/hwclock.exp
similarity index 78%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/hwclock.exp
index 43f6272..b12951a 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/hwclock.exp
@@ -11,9 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "abook "
-
-
+assert_complete_any "hwclock -"
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list