shell-completion: use systemctl --state=help

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2015-09-28 14:43:26 -04:00
parent 7e55de3b96
commit 840b2c0e77
2 changed files with 3 additions and 5 deletions

View 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

View 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[@]}"
}