Add rtcwake completion.

This commit is contained in:
Ville Skyttä 2009-12-30 22:59:17 +02:00
parent f321c377af
commit 9c402241c4
5 changed files with 65 additions and 2 deletions

View File

@ -29,8 +29,8 @@ bash-completion (2.x)
mysqladmin, rsync, screen, service, scp, ssh, sshfs, update-alternatives,
vncviewer, and general hostname completions.
* Add abook and wtf completion, based on work by Raphaël Droz.
* Add cvsps, fusermount, jarsigner, k3b, lftpget, pm-utils, pack200 and
unpack200 completions.
* Add cvsps, fusermount, jarsigner, k3b, lftpget, pm-utils, rtcwake, pack200
and unpack200 completions.
* Don't overwrite other host completions when completing from multiple
SSH known hosts files.
* Speed up installed rpm package completion on SUSE, based on work by

View File

@ -117,6 +117,7 @@ bashcomp_DATA = contrib/abook \
contrib/rpmcheck \
contrib/rrdtool \
contrib/rsync \
contrib/rtcwake \
contrib/samba \
contrib/sbcl \
contrib/screen \

39
contrib/rtcwake Normal file
View File

@ -0,0 +1,39 @@
# bash completion for rtcwake
have rtcwake &&
_rtcwake()
{
COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword` split=false
_split_longopt && split=true
case "$prev" in
--help|-h|--version|-V|--seconds|-s|--time|-t)
return 0
;;
--mode|-m)
COMPREPLY=( $( compgen -W 'standby mem disk on no off' -- "$cur" ) )
return 0
;;
--device|-d)
COMPREPLY=( $( command ls -d /dev/rtc* 2>/dev/null ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]#/dev/}' -- "$cur" ) )
return 0
;;
esac
$split && return 0
COMPREPLY=( $( compgen -W '--device --local --mode --seconds --time --utc \
--verbose --version --help' -- "$cur" ) )
} &&
complete -F _rtcwake rtcwake
# 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

View File

@ -0,0 +1,3 @@
if {[assert_bash_type rtcwake]} {
source "lib/completions/rtcwake.exp"
}; # if

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}; # setup()
proc teardown {} {
assert_env_unmodified
}; # teardown()
setup
assert_complete_any "rtcwake "
sync_after_int
teardown