]> git.ipfire.org Git - thirdparty/systemd.git/commit
bash-completion: systemctl: pass current partial unit to list-unit*
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 30 Apr 2018 11:53:50 +0000 (12:53 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 11 Jun 2018 16:09:55 +0000 (17:09 +0100)
commitc839b729c5f7b08f6d91bf9567d0b1f91d17e0f7
treec3ad024d6bfd343e6aece96173693d3b7ee60600
parentaedd48160f79de3372eb233ebbf9d8d47c22072a
bash-completion: systemctl: pass current partial unit to list-unit*

Pass the partial name of the unit file to list-unit-files and
list-units. This allows for faster completion, since systemctl does
not need to list all the unit files.

For reference:
 - time systemctl list-unit-files -> ~200ms
 - time systemctl list-unit-files netctl* -> ~15ms
 - time systemctl list-units -> ~5ms
 - time systemctl list-units netctl* -> ~5ms

While the list-units time itself is unaffected, now a shorter list is
produced. Thus as we pass it to `systemctl show' (via
__filter_units_by_properties) the execution time will be decreased even
further.

v2: Update list-units hunk in commit message, add quotes around $2*
v3: Remove funky indentation, quote all $cur instances

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
shell-completion/bash/systemctl.in