X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=shell-completion%2Fzsh%2F_hostnamectl;h=a7217a1999e14a28860dec1b79c5be6d2da3945f;hp=7effa0489ee8dabf29d3ca0d8f50f639b02ac03c;hb=0fa9e53d12a64981e071e0adb24698f4735e2599;hpb=4433c995c77b66f42fe4a238aff6b53706628a2e diff --git a/shell-completion/zsh/_hostnamectl b/shell-completion/zsh/_hostnamectl index 7effa0489..a7217a199 100644 --- a/shell-completion/zsh/_hostnamectl +++ b/shell-completion/zsh/_hostnamectl @@ -1,5 +1,38 @@ #compdef hostnamectl +_hostnamectl_set-hostname() { + if (( CURRENT <= 3 )); then + _message "new hostname" + else + _message "no more options" + fi +} + +_hostnamectl_set-icon-name() { + if (( CURRENT <= 3 )); then + _message "new icon name" + else + _message "no more options" + fi +} + +_hostnamectl_set-chassis() { + if (( CURRENT <= 3 )); then + _chassis=( desktop laptop server tablet handset watch embedded vm container ) + _describe chassis _chassis + else + _message "no more options" + fi +} + +_hostnamectl_set-deployment() { + if (( CURRENT <= 3 )); then + _message "new environment" + else + _message "no more options" + fi +} + _hostnamectl_command() { local -a _hostnamectl_cmds _hostnamectl_cmds=( @@ -7,6 +40,7 @@ _hostnamectl_command() { "set-hostname:Set system hostname" "set-icon-name:Set icon name for host" "set-chassis:Set chassis type for host" + "set-deployment:Set deployment environment" ) if (( CURRENT == 1 )); then _describe -t commands 'hostnamectl commands' _hostnamectl_cmds || compadd "$@" @@ -14,8 +48,11 @@ _hostnamectl_command() { local curcontext="$curcontext" cmd="${${_hostnamectl_cmds[(r)$words[1]:*]%%:*}}" if (( $#cmd )); then - [[ $cmd == status ]] && msg="no options" || msg="options for $cmd" - _message "$msg" + if [[ $cmd == status ]]; then + _message "no options" + else + _hostnamectl_$cmd + fi else _message "unknown hostnamectl command: $words[1]" fi