]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell-completion: use systemctl --state=help
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 28 Sep 2015 18:43:26 +0000 (14:43 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 28 Sep 2015 19:10:03 +0000 (15:10 -0400)
This way completion lists should stay up to date.

Also use systemctl -t help to list types in zsh, as was already
done in bash.

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

index 4d63e2870f177acc92a0ba9bf8f1f835318c157d..c8e17de7bc3884be68446e0ef960517f76f7c55d 100644 (file)
@@ -119,9 +119,7 @@ _systemctl () {
                                 comps=$(__systemctl $mode -t help)
                         ;;
                         --state)
-                                comps='loaded not-found stub
-                                       active inactive failed
-                                       dead elapsed exited listening mounted plugged running waiting'
+                                comps=$(__systemctl $mode --state=help)
                         ;;
                         --job-mode)
                                 comps='fail replace replace-irreversibly isolate
index 4bf306aacb4cd7f1a606827e64fb8f3e00b780ed..96f51a0ee0c0e5316e5846d2e83bfa818444b755 100644 (file)
@@ -334,13 +334,13 @@ _systemctl_caching_policy()
 
 _unit_states() {
     local -a _states
-    _states=(loaded failed active inactive not-found listening running waiting plugged mounted exited dead masked)
+    _states=("${(fo)$(__systemctl --state=help)}")
     _values -s , "${_states[@]}"
 }
 
 _unit_types() {
     local -a _types
-    _types=(automount busname device mount path service snapshot socket swap target timer)
+    _types=("${(fo)$(__systemctl -t help)}")
     _values -s , "${_types[@]}"
 }