chiark / gitweb /
shell-completion: work on session shell is --user is used
[elogind.git] / shell-completion / systemd-zsh-completion.zsh
index a8f7081459236a28332eb3fcf9b9ee78eeeee48e..46a6a1900c753a8dbacda11204412e5153d0ac64 100644 (file)
@@ -404,7 +404,9 @@ _outputmodes() {
 
 __systemctl()
 {
-  systemctl --full --no-legend --no-pager "$@"
+  local -a _modes
+  _modes=("--user" "--system")
+  systemctl ${words:*_modes} --full --no-legend --no-pager "$@"
 }
 
 
@@ -556,7 +558,7 @@ done
 (( $+functions[_systemctl_delete] )) || _systemctl_delete()
 {
   compadd "$@" - $(__systemctl list-units --type snapshot --all \
-    | cut -d' ' -f1  2>/dev/null ) || _message "no snampshot found"
+    | cut -d' ' -f1  2>/dev/null ) || _message "no snapshot found"
 }
 
 # Completion functions for ENVS