]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
zsh: use sys_really_all_units for non-template names
authorRonan Pigott <ronan@rjp.ie>
Mon, 7 Aug 2023 19:13:23 +0000 (12:13 -0700)
committerRonan Pigott <ronan@rjp.ie>
Tue, 8 Aug 2023 01:00:04 +0000 (18:00 -0700)
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

index 06a4be6b3384716798bfc776b47a8394495782ea..7b67ece1b0cb4d5ef87ec22d7657cc8b619075e9 100644 (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() {