3 _hosts_or_user_at_host() {
5 'users-hosts:: _user_at_host' \
9 _hostnamectl_command() {
10 local -a _hostnamectl_cmds
12 "status:Show current hostname settings"
13 "set-hostname:Set system hostname"
14 "set-icon-name:Set icon name for host"
16 if (( CURRENT == 1 )); then
17 _describe -t commands 'hostnamectl commands' _hostnamectl_cmds || compadd "$@"
19 local curcontext="$curcontext"
20 cmd="${${_hostnamectl_cmds[(r)$words[1]:*]%%:*}}"
22 [[ $cmd == status ]] && msg="no options" || msg="options for $cmd"
25 _message "unknown hostnamectl command: $words[1]"
31 {-h,--help}'[Show this help]' \
32 '--version[Show package version]' \
33 '--transient[Only set transient hostname]' \
34 '--static[Only set static hostname]' \
35 '--pretty[Only set pretty hostname]' \
36 '--no-ask-password[Do not prompt for password]' \
37 {-H,--host=}'[Operate on remote host]:userathost:_hosts_or_user_at_host' \
38 '*::hostnamectl commands:_hostnamectl_command'