]> git.ipfire.org Git - thirdparty/systemd.git/commit
zsh: reintroduce pattern argument to uncached verbs 28710/head
authorRonan Pigott <ronan@rjp.ie>
Tue, 8 Aug 2023 08:30:28 +0000 (01:30 -0700)
committerRonan Pigott <ronan@rjp.ie>
Tue, 8 Aug 2023 08:57:45 +0000 (01:57 -0700)
commit2cbda74862049be2003496c7d432341d53a0fdf9
tree64919e3172b9999ae6c4ac4be06f1409105c0a10
parentc8e2cd79c155151bcdb983eedd24a6a77082c41b
zsh: reintroduce pattern argument to uncached verbs

The systemctl completion previously made use of PREFIX as a pattern
argument to list-unit-files and list-units. This had the problem of
erroneously filtering the results that were stored in the cache, and
erroneously filtering results that might have been requested according
to the users configuration (e.g. _correct completer, certain
matcher-lists or tag-orders, etc.).

Unfortunately, the runtime of list-unit-files increases when no pattern
argument is provided, and systemctl show, used to filter those units,
can become unacceptably slow when provided with too many units to
describe.

Let's re-introduce the pattern argument to list-unit-files and
list-units where necessary in order to alleviate these bottlenecks
without poisining the cache. A 'use-pattern' style is introduced that
may be used to disable this behavior if it is undesired. We can still
expect that certain completions, like `systemctl start <TAB>` will be
slow, like before. To fix this we will need systemd to learn a more
efficient way of filtering the units than parsing systemctl show.
shell-completion/zsh/_systemctl.in