Skip to content

Commit ae6fb82

Browse files
committed
zsh: remove unit property caching
The existing caching policy isn't very sensible for this cache. We could write a different policy, but I don't think there is much value in caching these values, as in my experience the command used to generate them is quick.
1 parent 110ba0c commit ae6fb82

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

shell-completion/zsh/_systemctl.in

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,9 @@ done
451451

452452
(( $+functions[_systemctl_unit_properties] )) ||
453453
_systemctl_unit_properties() {
454-
if ( [[ ${+_sys_all_properties} -eq 0 ]] || _cache_invalid SYS_ALL_PROPERTIES$_sys_service_mgr ) ||
455-
! _retrieve_cache SYS_ALL_PROPERTIES$_sys_service_mgr;
456-
then
457-
_sys_all_properties=( ${${(M)${(f)"$({{ROOTLIBEXECDIR}}/systemd --dump-bus-properties)"}}} )
458-
_store_cache SYS_ALL_PROPERTIES$_sys_service_mgr _sys_all_properties
459-
fi
460-
_values -s , "${_sys_all_properties[@]}"
454+
local -a _sys_all_properties=( ${(f)"$({{ROOTLIBEXECDIR}}/systemd --no-pager --dump-bus-properties 2>/dev/null)"} )
455+
_wanted systemd-unit-properties expl 'unit property' \
456+
_values -s , "${_sys_all_properties[@]}"
461457
}
462458

463459
(( $+functions[_systemctl_job_modes] )) ||

0 commit comments

Comments
 (0)