From c8e2cd79c155151bcdb983eedd24a6a77082c41b Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Mon, 7 Aug 2023 12:13:23 -0700 Subject: [PATCH] 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. --- shell-completion/zsh/_systemctl.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index 06a4be6b338..7b67ece1b0c 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -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() { -- 2.47.3