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.
This commit is contained in:
Ronan Pigott 2023-08-07 12:13:23 -07:00
parent 97eb826821
commit c8e2cd79c1

View file

@ -194,10 +194,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() {