summaryrefslogtreecommitdiffstats
path: root/shell-completion
diff options
context:
space:
mode:
authorRonan Pigott <ronan@rjp.ie>2023-07-18 01:06:59 +0200
committerRonan Pigott <ronan@rjp.ie>2023-07-18 01:38:25 +0200
commit8a8caeccb27a375913b9d1787664656dce1f4511 (patch)
tree2edafbe8b5db7236c2a2d4837b0255d3c7874e7d /shell-completion
parentzsh: default to system manager when not specified (diff)
downloadsystemd-8a8caeccb27a375913b9d1787664656dce1f4511.tar.xz
systemd-8a8caeccb27a375913b9d1787664656dce1f4511.zip
zsh: stop forcing unit file cache rebuilds
Rebuilding whenever the cached parameter is not set forces each new shell to rebuild the cache, which often defeates the purpose of caching in the first place.
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/zsh/_systemctl.in6
1 files changed, 2 insertions, 4 deletions
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index 98b4d2eb65..5a6e7d391d 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -161,8 +161,7 @@ __systemctl()
(( $+functions[_systemctl_all_units] )) ||
_systemctl_all_units()
{
- if ( [[ ${+_sys_all_units} -eq 0 ]] || _cache_invalid SYS_ALL_UNITS$_sys_service_mgr ) ||
- ! _retrieve_cache SYS_ALL_UNITS$_sys_service_mgr;
+ if _cache_invalid SYS_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_ALL_UNITS$_sys_service_mgr;
then
_sys_all_units=( ${${(f)"$(__systemctl list-units --all)"}%% *} )
_store_cache SYS_ALL_UNITS$_sys_service_mgr _sys_all_units
@@ -175,8 +174,7 @@ __systemctl()
{
local -a all_unit_files;
local -a really_all_units;
- if ( [[ ${+_sys_really_all_units} -eq 0 ]] || _cache_invalid SYS_REALLY_ALL_UNITS$_sys_service_mgr ) ||
- ! _retrieve_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr;
+ if _cache_invalid SYS_REALLY_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr;
then
all_unit_files=( ${${(f)"$(__systemctl list-unit-files)"}%% *} )
_systemctl_all_units