1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-21 18:03:41 +03:00

zsh: use sys_really_all_units for non-template names

The systemctl invocations used for these completions match the ones used
for the _sys_really_all_units parameter, so we should really just use
the cached parameter rather than recomputing the result.

(cherry picked from commit c8e2cd79c155151bcdb983eedd24a6a77082c41b)
(cherry picked from commit 9814972198a11591bbb10dfb99e9d50a4bed055b)
(cherry picked from commit f664081482f4a713e0dbfdd940c4b1d2fa78314e)
This commit is contained in:
Ronan Pigott 2023-08-07 12:13:23 -07:00 committed by Luca Boccassi
parent 4ed6a3191f
commit af20c4f05c

View File

@ -193,10 +193,10 @@ __systemctl()
}
(( $+functions[_systemctl_get_non_template_names] )) ||
_systemctl_get_non_template_names() { echo -E - ${^${(R)${(f)"$(
__systemctl list-unit-files
__systemctl list-units --all
)"}:#*@.*}%%[[:space:]]*} }
_systemctl_get_non_template_names() {
_systemctl_really_all_units
print -r - ${_sys_really_all_units:#*@.*}
}
(( $+functions[_systemctl_get_template_names] )) ||
_systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files)"}##*@.[^[:space:]]##}%%@.*}\@ }