Skip to content

Commit f664081

Browse files
rpigottbluca
authored andcommitted
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 c8e2cd7) (cherry picked from commit 9814972)
1 parent a99dfdc commit f664081

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

shell-completion/zsh/_systemctl.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ __systemctl()
193193
}
194194

195195
(( $+functions[_systemctl_get_non_template_names] )) ||
196-
_systemctl_get_non_template_names() { echo -E - ${^${(R)${(f)"$(
197-
__systemctl list-unit-files
198-
__systemctl list-units --all
199-
)"}:#*@.*}%%[[:space:]]*} }
196+
_systemctl_get_non_template_names() {
197+
_systemctl_really_all_units
198+
print -r - ${_sys_really_all_units:#*@.*}
199+
}
200200

201201
(( $+functions[_systemctl_get_template_names] )) ||
202202
_systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files)"}##*@.[^[:space:]]##}%%@.*}\@ }

0 commit comments

Comments
 (0)