2009-12-30 22:59:17 +02:00
|
|
|
# bash completion for rtcwake
|
|
|
|
|
2011-04-05 00:35:51 +03:00
|
|
|
have rtcwake || return
|
|
|
|
|
2009-12-30 22:59:17 +02:00
|
|
|
_rtcwake()
|
|
|
|
{
|
|
|
|
COMPREPLY=()
|
2010-02-08 17:25:08 +01:00
|
|
|
local cur prev split=false
|
|
|
|
_get_comp_words_by_ref cur prev
|
2009-12-30 22:59:17 +02:00
|
|
|
|
|
|
|
_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)
|
2009-12-30 23:05:29 +02:00
|
|
|
COMPREPLY=( $( command ls -d /dev/rtc?* 2>/dev/null ) )
|
2009-12-30 22:59:17 +02:00
|
|
|
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
|