Add rtcwake completion.
This commit is contained in:
parent
f321c377af
commit
9c402241c4
4
CHANGES
4
CHANGES
@ -29,8 +29,8 @@ bash-completion (2.x)
|
|||||||
mysqladmin, rsync, screen, service, scp, ssh, sshfs, update-alternatives,
|
mysqladmin, rsync, screen, service, scp, ssh, sshfs, update-alternatives,
|
||||||
vncviewer, and general hostname completions.
|
vncviewer, and general hostname completions.
|
||||||
* Add abook and wtf completion, based on work by Raphaël Droz.
|
* Add abook and wtf completion, based on work by Raphaël Droz.
|
||||||
* Add cvsps, fusermount, jarsigner, k3b, lftpget, pm-utils, pack200 and
|
* Add cvsps, fusermount, jarsigner, k3b, lftpget, pm-utils, rtcwake, pack200
|
||||||
unpack200 completions.
|
and unpack200 completions.
|
||||||
* Don't overwrite other host completions when completing from multiple
|
* Don't overwrite other host completions when completing from multiple
|
||||||
SSH known hosts files.
|
SSH known hosts files.
|
||||||
* Speed up installed rpm package completion on SUSE, based on work by
|
* Speed up installed rpm package completion on SUSE, based on work by
|
||||||
|
@ -117,6 +117,7 @@ bashcomp_DATA = contrib/abook \
|
|||||||
contrib/rpmcheck \
|
contrib/rpmcheck \
|
||||||
contrib/rrdtool \
|
contrib/rrdtool \
|
||||||
contrib/rsync \
|
contrib/rsync \
|
||||||
|
contrib/rtcwake \
|
||||||
contrib/samba \
|
contrib/samba \
|
||||||
contrib/sbcl \
|
contrib/sbcl \
|
||||||
contrib/screen \
|
contrib/screen \
|
||||||
|
39
contrib/rtcwake
Normal file
39
contrib/rtcwake
Normal 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
|
3
test/completion/rtcwake.exp
Normal file
3
test/completion/rtcwake.exp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
if {[assert_bash_type rtcwake]} {
|
||||||
|
source "lib/completions/rtcwake.exp"
|
||||||
|
}; # if
|
20
test/lib/completions/rtcwake.exp
Normal file
20
test/lib/completions/rtcwake.exp
Normal 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
|
Loading…
x
Reference in New Issue
Block a user