[systemd-devel] [PATCH 12/16] shell-comp: Split out zsh _systemd-analyze

William Giokas 1007380 at gmail.com
Tue Jul 30 21:22:50 PDT 2013


---
 Makefile.am                           |  1 +
 shell-completion/zsh/_systemd         | 28 +---------------------------
 shell-completion/zsh/_systemd-analyze | 26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 27 deletions(-)
 create mode 100644 shell-completion/zsh/_systemd-analyze

diff --git a/Makefile.am b/Makefile.am
index a4443fb..4ac09cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -348,6 +348,7 @@ dist_zshcompletion_DATA = \
 	shell-completion/zsh/_journalctl \
 	shell-completion/zsh/_udevadm \
 	shell-completion/zsh/_systemd-nspawn \
+	shell-completion/zsh/_systemd-analyze \
 	shell-completion/zsh/_systemd
 
 dist_sysctl_DATA = \
diff --git a/shell-completion/zsh/_systemd b/shell-completion/zsh/_systemd
index 6908725..d0e1f3d 100644
--- a/shell-completion/zsh/_systemd
+++ b/shell-completion/zsh/_systemd
@@ -1,17 +1,9 @@
-#compdef systemd-analyze systemd-cat systemd-ask-password systemd-cgls systemd-cgtop systemd-delta systemd-detect-virt systemd-machine-id-setup systemd-notify systemd-tmpfiles systemd-tty-ask-password-agent machinectl
+#compdef systemd-cat systemd-ask-password systemd-cgls systemd-cgtop systemd-delta systemd-detect-virt systemd-machine-id-setup systemd-notify systemd-tmpfiles systemd-tty-ask-password-agent machinectl
 
 _ctls()
 {
     local curcontext="$curcontext" state lstate line
     case "$service" in
-        systemd-analyze)
-            _arguments \
-                {-h,--help}'[Show help text.]' \
-                '--user[Shows performance data of user sessions instead of the system manager.]' \
-                '--order[When generating graph for dot, show only order]' \
-                '--require[When generating graph for dot, show only requirement]' \
-                '*::systemd-analyze commands:_systemd_analyze_command'
-        ;;
         systemd-ask-password)
             _arguments \
                 {-h,--help}'[Show this help]' \
@@ -125,24 +117,6 @@ _ctls()
     esac
 }
 
-_systemd_analyze_command(){
-    local -a _systemd_analyze_cmds
-    # Descriptions taken from systemd-analyze --help.
-    _systemd_analyze_cmds=(
-        'time:Print time spent in the kernel before reaching userspace'
-        'blame:Print list of running units ordered by time to init'
-        'critical-chain:Print a tree of the time critical chain of units'
-        'plot:Output SVG graphic showing service initialization'
-        'dot:Dump dependency graph (in dot(1) format)'
-    )
-
-    if (( CURRENT == 1 )); then
-        _describe "options" _systemd_analyze_cmds
-    else
-        _message "no more options"
-    fi
-}
-
 _hosts_or_user_at_host()
 {
   _alternative \
diff --git a/shell-completion/zsh/_systemd-analyze b/shell-completion/zsh/_systemd-analyze
new file mode 100644
index 0000000..13e96c0
--- /dev/null
+++ b/shell-completion/zsh/_systemd-analyze
@@ -0,0 +1,26 @@
+#compdef systemd-analyze
+
+_systemd_analyze_command(){
+    local -a _systemd_analyze_cmds
+    # Descriptions taken from systemd-analyze --help.
+    _systemd_analyze_cmds=(
+        'time:Print time spent in the kernel before reaching userspace'
+        'blame:Print list of running units ordered by time to init'
+        'critical-chain:Print a tree of the time critical chain of units'
+        'plot:Output SVG graphic showing service initialization'
+        'dot:Dump dependency graph (in dot(1) format)'
+    )
+
+    if (( CURRENT == 1 )); then
+        _describe "options" _systemd_analyze_cmds
+    else
+        _message "no more options"
+    fi
+}
+
+_arguments \
+    {-h,--help}'[Show help text.]' \
+    '--user[Shows performance data of user sessions instead of the system manager.]' \
+    '--order[When generating graph for dot, show only order]' \
+    '--require[When generating graph for dot, show only requirement]' \
+    '*::systemd-analyze commands:_systemd_analyze_command'
-- 
1.8.4.rc0.352.g531e8cb



More information about the systemd-devel mailing list