3 _hostnamectl_command() {
4 local -a _hostnamectl_cmds
6 "status:Show current hostname settings"
7 "set-hostname:Set system hostname"
8 "set-icon-name:Set icon name for host"
10 if (( CURRENT == 1 )); then
11 _describe -t commands 'hostnamectl commands' _hostnamectl_cmds || compadd "$@"
13 local curcontext="$curcontext"
14 cmd="${${_hostnamectl_cmds[(r)$words[1]:*]%%:*}}"
16 [[ $cmd == status ]] && msg="no options" || msg="options for $cmd"
19 _message "unknown hostnamectl command: $words[1]"
25 {-h,--help}'[Show this help]' \
26 '--version[Show package version]' \
27 '--transient[Only set transient hostname]' \
28 '--static[Only set static hostname]' \
29 '--pretty[Only set pretty hostname]' \
30 '--no-ask-password[Do not prompt for password]' \
31 {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
32 '*::hostnamectl commands:_hostnamectl_command'