diff options
author | Jakub Warczarek <jakub.warczarek@gmail.com> | 2021-04-23 20:41:45 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-05-03 20:19:19 +0200 |
commit | 572c55ee3cbeb2a7ed4600aec2530ffa7e7a3a87 (patch) | |
tree | 11fc1bd4badb1d99a83f6f57b2c69d43b5058b38 /shell-completion | |
parent | core: apply LogLevelMax to messages about units (diff) | |
download | systemd-572c55ee3cbeb2a7ed4600aec2530ffa7e7a3a87.tar.xz systemd-572c55ee3cbeb2a7ed4600aec2530ffa7e7a3a87.zip |
hostnamectl: deprecate set-* methods and expose getters by only using nouns in commands
Diffstat (limited to 'shell-completion')
-rw-r--r-- | shell-completion/bash/hostnamectl | 6 | ||||
-rw-r--r-- | shell-completion/zsh/_hostnamectl | 30 |
2 files changed, 18 insertions, 18 deletions
diff --git a/shell-completion/bash/hostnamectl b/shell-completion/bash/hostnamectl index e3765c315c..5c8d3975d7 100644 --- a/shell-completion/bash/hostnamectl +++ b/shell-completion/bash/hostnamectl @@ -38,9 +38,9 @@ _hostnamectl() { local -A VERBS=( [STANDALONE]='status' - [ICONS]='set-icon-name' - [NAME]='set-hostname set-deployment set-location' - [CHASSIS]='set-chassis' + [ICONS]='icon-name' + [NAME]='hostname deployment location' + [CHASSIS]='chassis' ) for ((i=0; i < COMP_CWORD; i++)); do diff --git a/shell-completion/zsh/_hostnamectl b/shell-completion/zsh/_hostnamectl index d05c46bd43..2a6bf4d125 100644 --- a/shell-completion/zsh/_hostnamectl +++ b/shell-completion/zsh/_hostnamectl @@ -1,8 +1,8 @@ #compdef hostnamectl -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1-or-later -(( $+functions[_hostnamectl_set-hostname] )) || -_hostnamectl_set-hostname() { +(( $+functions[_hostnamectl_hostname] )) || +_hostnamectl_hostname() { if (( CURRENT <= 3 )); then _message "new hostname" else @@ -10,8 +10,8 @@ _hostnamectl_set-hostname() { fi } -(( $+functions[_hostnamectl_set-icon-name] )) || -_hostnamectl_set-icon-name() { +(( $+functions[_hostnamectl_icon-name] )) || +_hostnamectl_icon-name() { if (( CURRENT <= 3 )); then _message "new icon name" else @@ -19,8 +19,8 @@ _hostnamectl_set-icon-name() { fi } -(( $+functions[_hostnamectl_set-chassis] )) || -_hostnamectl_set-chassis() { +(( $+functions[_hostnamectl_chassis] )) || +_hostnamectl_chassis() { if (( CURRENT <= 3 )); then _chassis=( desktop laptop convertible server tablet handset watch embedded vm container ) _describe chassis _chassis @@ -29,8 +29,8 @@ _hostnamectl_set-chassis() { fi } -(( $+functions[_hostnamectl_set-deployment] )) || -_hostnamectl_set-deployment() { +(( $+functions[_hostnamectl_deployment] )) || +_hostnamectl_deployment() { if (( CURRENT <= 3 )); then _message "new environment" else @@ -38,8 +38,8 @@ _hostnamectl_set-deployment() { fi } -(( $+functions[_hostnamectl_set-location] )) || -_hostnamectl_set-location() { +(( $+functions[_hostnamectl_location] )) || +_hostnamectl_location() { if (( CURRENT <= 3 )); then _message "new location" else @@ -52,11 +52,11 @@ _hostnamectl_commands() { local -a _hostnamectl_cmds _hostnamectl_cmds=( "status:Show current hostname settings" - "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 for host" - "set-location:Set location for host" + "hostname:Get/set system hostname" + "icon-name:Get/set icon name for host" + "chassis:Get/set chassis type for host" + "deployment:Get/set deployment environment for host" + "location:Get/set location for host" ) if (( CURRENT == 1 )); then _describe -t commands 'hostnamectl commands' _hostnamectl_cmds || compadd "$@" |