aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_systemctl_services.fish
diff options
context:
space:
mode:
authorGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2014-11-10 12:50:17 +0800
committerGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2014-11-10 12:51:07 +0800
commit00e0ed64bc2e4b918357b10fbd176797eeb07402 (patch)
treeb0109c93e36319476d83618a661c59c98c8a1679 /share/functions/__fish_systemctl_services.fish
parentf2447c537ef3c944da87e00e13f816d3a6c7548f (diff)
__fish_systemctl_*: use systemctl to generate the list of units
Closes #1804. Note that if systemd is not running, the completion will fail.
Diffstat (limited to 'share/functions/__fish_systemctl_services.fish')
-rw-r--r--share/functions/__fish_systemctl_services.fish5
1 files changed, 3 insertions, 2 deletions
diff --git a/share/functions/__fish_systemctl_services.fish b/share/functions/__fish_systemctl_services.fish
index a9fd38ba..f48cb324 100644
--- a/share/functions/__fish_systemctl_services.fish
+++ b/share/functions/__fish_systemctl_services.fish
@@ -1,4 +1,5 @@
function __fish_systemctl_services
- command find /etc/systemd/system -type f -name '*.service' -printf '%f\n'
- command find /usr/lib/systemd/system -type f -name '*.service' -printf '%f\n'
+ if type -q systemctl
+ systemctl list-unit-files --no-legend --type=service ^/dev/null | cut -f 1 -d ' '
+ end
end