3 _timedatectl_set-timezone(){
5 _timezones=( ${(f)"$(_call_program timezones "${service}" list-timezones)"} )
6 compadd "$_timezones[@]"
9 _timedatectl_set-time(){
10 _message "YYYY-MM-DD HH:MM:SS"
13 _timedatectl_set-local-rtc(){
16 '0:Maintain RTC in universal time'
17 '1:Maintain RTC in local time'
19 _describe options _options
22 _timedatectl_set-ntp(){
25 '0:Disable NTP based network time configuration'
26 '1:Enable NTP based network time configuration'
28 _describe options _options
31 _timedatectl_command(){
32 local -a _timedatectl_cmds
34 'status:Show current time settings'
35 'set-time:Set system time'
36 'set-timezone:Set system timezone'
37 'list-timezones:Show known timezones'
38 'set-local-rtc:Control whether RTC is in local time'
39 'set-ntp:Control whether NTP is enabled'
41 if (( CURRENT == 1 )); then
42 _describe -t commands 'timedatectl command' _timedatectl_cmds
44 local curcontext="$curcontext"
45 cmd="${${_timedatectl_cmds[(r)$words[1]:*]%%:*}}"
47 if (( $+functions[_timedatectl_$cmd] )); then
50 _message "no more options"
53 _message "unknown timedatectl command: $words[1]"
59 {-h,--help}'[Show this help]' \
60 '--version[Show package version]' \
61 '--adjust-system-clock[Adjust system clock when changing local RTC mode]' \
62 '--no-pager[Do not pipe output into a pager]' \
63 '--no-ask-password[Do not prompt for password]' \
64 {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
65 '*::timedatectl commands:_timedatectl_command'