]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/rtcwake
rtcwake: add human readable --date timestamp format
[thirdparty/util-linux.git] / bash-completion / rtcwake
1 _rtcwake_module()
2 {
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-d'|'--device')
9 local RTC_DEVS
10 RTC_DEVS=$(cd /sys/class/rtc/ && echo *)
11 COMPREPLY=( $(compgen -W "$RTC_DEVS" -- $cur) )
12 return 0
13 ;;
14 '-m'|'--mode')
15 COMPREPLY=( $(compgen -W "standby mem disk off no on disable show" -- $cur) )
16 return 0
17 ;;
18 '-s'|'--seconds')
19 COMPREPLY=( $(compgen -W "seconds" -- $cur) )
20 return 0
21 ;;
22 '-t'|'--time')
23 COMPREPLY=( $(compgen -W "time_t" -- $cur) )
24 return 0
25 ;;
26 '--date')
27 COMPREPLY=( $(compgen -W "YYYYMMDDhhmmss" -- $cur) )
28 return 0
29 ;;
30 '-h'|'--help'|'-V'|'--version')
31 return 0
32 ;;
33 esac
34 OPTS=" --date
35 --device
36 --dry-run
37 --local
38 --mode
39 --seconds
40 --time
41 --utc
42 --verbose
43 --help
44 --version"
45 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
46 return 0
47 }
48 complete -F _rtcwake_module rtcwake