]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/rtcwake
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / rtcwake
CommitLineData
c6f8c3f5
SK
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
d092911b
SK
8 '-A'|'--adjfile')
9 local IFS=$'\n'
10 compopt -o filenames
11 COMPREPLY=( $(compgen -f -- $cur) )
12 return 0
13 ;;
c6f8c3f5
SK
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')
43a44bfc 21 COMPREPLY=( $(compgen -W "$(rtcwake --list-modes)" -- $cur) )
c6f8c3f5
SK
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 ;;
a10ce9a3
SK
32 '--date')
33 COMPREPLY=( $(compgen -W "YYYYMMDDhhmmss" -- $cur) )
34 return 0
35 ;;
d4f9b8d7
VS
36 '-h'|'--help'|'-V'|'--version')
37 return 0
38 ;;
c6f8c3f5 39 esac
d092911b
SK
40 OPTS="
41 --auto
42 --adjfile
43 --date
a10ce9a3 44 --device
0d5b9b8a
VS
45 --dry-run
46 --local
d092911b 47 --list-modes
0d5b9b8a
VS
48 --mode
49 --seconds
50 --time
51 --utc
52 --verbose
53 --help
d092911b
SK
54 --version
55 "
c6f8c3f5
SK
56 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
57 return 0
58}
59complete -F _rtcwake_module rtcwake