dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
923a60
From 15e2a6ebee7eab4a9b2ef57082e949ead17cdd85 Mon Sep 17 00:00:00 2001
923a60
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
923a60
Date: Thu, 2 Apr 2015 22:54:35 -0400
923a60
Subject: [PATCH] shell-completion: systemctl switch-root verb
923a60
923a60
The completion is rudimentary (all files). I think this is OK since
923a60
this is used so rarely. But not having it proposed at all is annoying.
923a60
923a60
(cherry picked from commit 7b742b3130941b5c8d5e178b6694428fb3b61086)
923a60
923a60
Cherry-picked from: 166cee1
923a60
Resolves: #1222517
923a60
---
923a60
 shell-completion/bash/systemctl.in | 2 +-
923a60
 shell-completion/zsh/_systemctl.in | 5 +++++
923a60
 2 files changed, 6 insertions(+), 1 deletion(-)
923a60
923a60
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
923a60
index 8063316ec6..3d787cdb77 100644
923a60
--- a/shell-completion/bash/systemctl.in
923a60
+++ b/shell-completion/bash/systemctl.in
923a60
@@ -160,7 +160,7 @@ _systemctl () {
923a60
                              reboot rescue show-environment suspend get-default
923a60
                              is-system-running'
923a60
                      [NAME]='snapshot'
923a60
-                     [FILE]='link'
923a60
+                     [FILE]='link switch-root'
923a60
                   [TARGETS]='set-default'
923a60
         )
923a60
 
923a60
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
923a60
index 7f2d5ac0fa..82edfd3d74 100644
923a60
--- a/shell-completion/zsh/_systemctl.in
923a60
+++ b/shell-completion/zsh/_systemctl.in
923a60
@@ -59,6 +59,7 @@
923a60
     "reboot:Shut down and reboot the system"
923a60
     "kexec:Shut down and reboot the system with kexec"
923a60
     "exit:Ask for user instance termination"
923a60
+    "switch-root:Change root directory"
923a60
   )
923a60
 
923a60
   if (( CURRENT == 1 )); then
923a60
@@ -297,6 +298,10 @@ done
923a60
    _sd_unit_files
923a60
 }
923a60
 
923a60
+(( $+functions[_systemctl_switch-root] )) || _systemctl_switch-root() {
923a60
+   _files
923a60
+}
923a60
+
923a60
 # no systemctl completion for:
923a60
 #    [STANDALONE]='daemon-reexec daemon-reload default
923a60
 #                  emergency exit halt kexec list-jobs list-units