3 _hostnamectl_set-hostname() {
4 if (( CURRENT <= 3 )); then
5 _message "new hostname"
7 _message "no more options"
11 _hostnamectl_set-icon-name() {
12 if (( CURRENT <= 3 )); then
13 _message "new icon name"
15 _message "no more options"
19 _hostnamectl_set-chassis() {
20 if (( CURRENT <= 3 )); then
21 _chassis=( desktop laptop server tablet handset watch vm container )
22 _describe chassis _chassis
24 _message "no more options"
28 _hostnamectl_command() {
29 local -a _hostnamectl_cmds
31 "status:Show current hostname settings"
32 "set-hostname:Set system hostname"
33 "set-icon-name:Set icon name for host"
34 "set-chassis:Set chassis type for host"
36 if (( CURRENT == 1 )); then
37 _describe -t commands 'hostnamectl commands' _hostnamectl_cmds || compadd "$@"
39 local curcontext="$curcontext"
40 cmd="${${_hostnamectl_cmds[(r)$words[1]:*]%%:*}}"
42 if [[ $cmd == status ]]; then
48 _message "unknown hostnamectl command: $words[1]"
54 {-h,--help}'[Show this help]' \
55 '--version[Show package version]' \
56 '--transient[Only set transient hostname]' \
57 '--static[Only set static hostname]' \
58 '--pretty[Only set pretty hostname]' \
59 '--no-ask-password[Do not prompt for password]' \
60 {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
61 '*::hostnamectl commands:_hostnamectl_command'