mirror of
https://github.com/systemd/systemd
synced 2024-10-04 15:21:01 +00:00
zsh: use glob matching for template names
Template names can be learned from the filesystem, so there isn't a need to parse the output of systemctl list-unit-files in this case. This should accelerate the completion of some verbs like enable.
This commit is contained in:
parent
ae6fb82cd9
commit
9ec0808370
|
@ -200,7 +200,10 @@ __systemctl()
|
|||
)"}:#*@.*}%%[[:space:]]*} }
|
||||
|
||||
(( $+functions[_systemctl_get_template_names] )) ||
|
||||
_systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files)"}##*@.[^[:space:]]##}%%@.*}\@ }
|
||||
_systemctl_get_template_names() {
|
||||
local pathkind=systemd-search-${_sys_service_mgr##*--}-unit
|
||||
print -r - ${(s-:-)^$(_call_program $pathkind systemd-path $pathkind)}/*@.(${(~j.|.)$(__systemctl --type=help)})(N:t:r)
|
||||
}
|
||||
|
||||
(( $+functions[_systemctl_active_units] )) ||
|
||||
_systemctl_active_units() {_sys_active_units=( ${${(f)"$(__systemctl list-units)"}%% *} )}
|
||||
|
|
Loading…
Reference in a new issue