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