anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
923a60
From 2cfba1646374d8d10431d0bd647b734ad4f59a49 Mon Sep 17 00:00:00 2001
923a60
From: Ronny Chevalier <chevalier.ronny@gmail.com>
923a60
Date: Tue, 7 Apr 2015 20:14:28 +0200
923a60
Subject: [PATCH] zsh-completion: update hostnamectl
923a60
923a60
(cherry picked from commit d67b1f525f488e5dfc076972cccf2a6411257fb8)
923a60
923a60
Cherry-picked from: c5b43a4
923a60
Resolves: #1222517
923a60
---
923a60
 shell-completion/zsh/_hostnamectl | 12 +++++++++++-
923a60
 1 file changed, 11 insertions(+), 1 deletion(-)
923a60
923a60
diff --git a/shell-completion/zsh/_hostnamectl b/shell-completion/zsh/_hostnamectl
923a60
index a7217a1999..7528e0649d 100644
923a60
--- a/shell-completion/zsh/_hostnamectl
923a60
+++ b/shell-completion/zsh/_hostnamectl
923a60
@@ -33,6 +33,14 @@ _hostnamectl_set-deployment() {
923a60
     fi
923a60
 }
923a60
 
923a60
+_hostnamectl_set-location() {
923a60
+    if (( CURRENT <= 3 )); then
923a60
+        _message "new location"
923a60
+    else
923a60
+        _message "no more options"
923a60
+    fi
923a60
+}
923a60
+
923a60
 _hostnamectl_command() {
923a60
     local -a _hostnamectl_cmds
923a60
     _hostnamectl_cmds=(
923a60
@@ -40,7 +48,8 @@ _hostnamectl_command() {
923a60
         "set-hostname:Set system hostname"
923a60
         "set-icon-name:Set icon name for host"
923a60
         "set-chassis:Set chassis type for host"
923a60
-        "set-deployment:Set deployment environment"
923a60
+        "set-deployment:Set deployment environment for host"
923a60
+        "set-location:Set location for host"
923a60
     )
923a60
     if (( CURRENT == 1 )); then
923a60
         _describe -t commands 'hostnamectl commands' _hostnamectl_cmds || compadd "$@"
923a60
@@ -67,4 +76,5 @@ _arguments -s \
923a60
     '--pretty[Only set pretty hostname]' \
923a60
     '--no-ask-password[Do not prompt for password]' \
923a60
     {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
923a60
+    {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \
923a60
     '*::hostnamectl commands:_hostnamectl_command'