]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/rtcwake
rev: be careful with close()
[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 '-A'|'--adjfile')
9 local IFS=$'\n'
10 compopt -o filenames
11 COMPREPLY=( $(compgen -f -- $cur) )
12 return 0
13 ;;
14 '-d'|'--device')
15 local RTC_DEVS
16 RTC_DEVS=$(cd /sys/class/rtc/ && echo *)
17 COMPREPLY=( $(compgen -W "$RTC_DEVS" -- $cur) )
18 return 0
19 ;;
20 '-m'|'--mode')
21 COMPREPLY=( $(compgen -W "$(rtcwake --list-modes)" -- $cur) )
22 return 0
23 ;;
24 '-s'|'--seconds')
25 COMPREPLY=( $(compgen -W "seconds" -- $cur) )
26 return 0
27 ;;
28 '-t'|'--time')
29 COMPREPLY=( $(compgen -W "time_t" -- $cur) )
30 return 0
31 ;;
32 '--date')
33 COMPREPLY=( $(compgen -W "YYYYMMDDhhmmss" -- $cur) )
34 return 0
35 ;;
36 '-h'|'--help'|'-V'|'--version')
37 return 0
38 ;;
39 esac
40 OPTS="
41 --auto
42 --adjfile
43 --date
44 --device
45 --dry-run
46 --local
47 --list-modes
48 --mode
49 --seconds
50 --time
51 --utc
52 --verbose
53 --help
54 --version
55 "
56 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
57 return 0
58 }
59 complete -F _rtcwake_module rtcwake