__fish_systemctl_*: use systemctl to generate the list of units

Closes #1804.

Note that if systemd is not running, the completion will fail.
This commit is contained in:
David Adam
2014-11-10 12:50:17 +08:00
parent f2447c537e
commit 00e0ed64bc
4 changed files with 12 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
function __fish_systemctl_mounts
command find /etc/systemd/system -type f -name '*.mount' -printf '%f\n'
command find /usr/lib/systemd/system -type f -name '*.mount' -printf '%f\n'
if type -q systemctl
systemctl list-unit-files --no-legend --type=mount ^/dev/null | cut -f 1 -d ' '
end
end