chiark / gitweb /
shell-completion: systemctl set-default,get-default,is-system-running
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Oct 2014 02:34:28 +0000 (21:34 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Oct 2014 02:34:28 +0000 (22:34 -0400)
TODO
shell-completion/bash/systemctl.in
shell-completion/zsh/_systemctl.in

diff --git a/TODO b/TODO
index ac70ec5f8d2b7d1a250ed7141d58aef7e8a64705..acac4e31cc130cd90d5d6750257529b1f842d1b8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -792,8 +792,10 @@ External:
 
 * register catalog database signature as file magic
 
 
 * register catalog database signature as file magic
 
-* zsh shell completion: <command> <verb> -<TAB> should complete options, but currently
-  does not
+* zsh shell completion:
+  - <command> <verb> -<TAB> should complete options, but currently does not
+  - systemctl add-wants,add-requires
+
 
 Regularly:
 
 
 Regularly:
 
index 8c1ecd486eee0733f9632358aee9008f0f02cfff..1c44a8df012ab000fd357043743b689d33177a5a 100644 (file)
@@ -148,7 +148,8 @@ _systemctl () {
                [STANDALONE]='daemon-reexec daemon-reload default
                              emergency exit halt hibernate hybrid-sleep kexec list-jobs
                              list-sockets list-timers list-units list-unit-files poweroff
                [STANDALONE]='daemon-reexec daemon-reload default
                              emergency exit halt hibernate hybrid-sleep kexec list-jobs
                              list-sockets list-timers list-units list-unit-files poweroff
-                             reboot rescue show-environment suspend get-default'
+                             reboot rescue show-environment suspend get-default
+                             is-system-running'
                      [NAME]='snapshot'
                      [FILE]='link'
                   [TARGETS]='set-default'
                      [NAME]='snapshot'
                      [FILE]='link'
                   [TARGETS]='set-default'
index 1435dee7243315462fb598dd4fb681f6cc8860f2..44981fe85d8d020df31e181e7ce53dafa12891b0 100644 (file)
@@ -31,6 +31,9 @@
     "disable:Disable one or more unit files"
     "reenable:Reenable one or more unit files"
     "preset:Enable/disable one or more unit files based on preset configuration"
     "disable:Disable one or more unit files"
     "reenable:Reenable one or more unit files"
     "preset:Enable/disable one or more unit files based on preset configuration"
+    "set-default:Set the default target"
+    "get-default:Query the default target"
+    "is-system-running:Query overall status of the system"
     "help:Show documentation for specified units"
     "list-dependencies:Show unit dependency tree"
     "mask:Mask one or more units"
     "help:Show documentation for specified units"
     "list-dependencies:Show unit dependency tree"
     "mask:Mask one or more units"
@@ -237,21 +240,28 @@ done
 (( $+functions[_systemctl_unmask] )) || _systemctl_unmask()
 {
   _systemctl_masked_units
 (( $+functions[_systemctl_unmask] )) || _systemctl_unmask()
 {
   _systemctl_masked_units
-  compadd "$@" -a - _sys_masked_units || _message "no masked unit found"
+  compadd "$@" -a - _sys_masked_units || _message "no masked units found"
 }
 
 # Completion functions for JOBS
 (( $+functions[_systemctl_cancel] )) || _systemctl_cancel()
 {
   compadd "$@" - $(__systemctl list-jobs \
 }
 
 # Completion functions for JOBS
 (( $+functions[_systemctl_cancel] )) || _systemctl_cancel()
 {
   compadd "$@" - $(__systemctl list-jobs \
-    | cut -d' ' -f1  2>/dev/null ) || _message "no job found"
+    | cut -d' ' -f1  2>/dev/null ) || _message "no jobs found"
 }
 
 # Completion functions for SNAPSHOTS
 (( $+functions[_systemctl_delete] )) || _systemctl_delete()
 {
   compadd "$@" - $(__systemctl list-units --type snapshot --all \
 }
 
 # Completion functions for SNAPSHOTS
 (( $+functions[_systemctl_delete] )) || _systemctl_delete()
 {
   compadd "$@" - $(__systemctl list-units --type snapshot --all \
-    | cut -d' ' -f1  2>/dev/null ) || _message "no snapshot found"
+    | cut -d' ' -f1  2>/dev/null ) || _message "no snapshots found"
+}
+
+# Completion functions for TARGETS
+(( $+functions[_systemctl_set-default] )) || _systemctl_set-default()
+{
+  compadd "$@" - $(__systemctl list-unit-files --type target --all \
+    | cut -d' ' -f1  2>/dev/null ) || _message "no targets found"
 }
 
 # Completion functions for ENVS
 }
 
 # Completion functions for ENVS