]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell-completion: systemctl switch-root verb
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 3 Apr 2015 02:54:35 +0000 (22:54 -0400)
committerzbyszek <zbyszek@deli.byod.gmu.edu>
Wed, 8 Apr 2015 15:28:45 +0000 (11:28 -0400)
The completion is rudimentary (all files). I think this is OK since
this is used so rarely. But not having it proposed at all is annoying.

shell-completion/bash/systemctl.in
shell-completion/zsh/_systemctl.in

index 773a59db38ebf19ae03cbf3fa5aa9c1144ab0aa5..34c9444353315c22d3af2d74b7d6a2ac1da01a9f 100644 (file)
@@ -160,7 +160,7 @@ _systemctl () {
                              reboot rescue show-environment suspend get-default
                              is-system-running'
                      [NAME]='snapshot'
-                     [FILE]='link'
+                     [FILE]='link switch-root'
                   [TARGETS]='set-default'
         )
 
index 3bbfb6f18783383192f0bbf6317634cd0beada34..cce9dea8b5ebef15f9bebcee825f2c7f9cbf4515 100644 (file)
@@ -59,6 +59,7 @@
     "reboot:Shut down and reboot the system"
     "kexec:Shut down and reboot the system with kexec"
     "exit:Ask for user instance termination"
+    "switch-root:Change root directory"
   )
 
   if (( CURRENT == 1 )); then
@@ -297,6 +298,10 @@ done
    _sd_unit_files
 }
 
+(( $+functions[_systemctl_switch-root] )) || _systemctl_switch-root() {
+   _files
+}
+
 # no systemctl completion for:
 #    [STANDALONE]='daemon-reexec daemon-reload default
 #                  emergency exit halt kexec list-jobs list-units