diff options
author | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2014-11-10 12:50:17 +0800 |
---|---|---|
committer | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2014-11-10 12:51:07 +0800 |
commit | 00e0ed64bc2e4b918357b10fbd176797eeb07402 (patch) | |
tree | b0109c93e36319476d83618a661c59c98c8a1679 /share/functions/__fish_systemctl_service_paths.fish | |
parent | f2447c537ef3c944da87e00e13f816d3a6c7548f (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_service_paths.fish')
-rw-r--r-- | share/functions/__fish_systemctl_service_paths.fish | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/share/functions/__fish_systemctl_service_paths.fish b/share/functions/__fish_systemctl_service_paths.fish index 6f8435cf..2f79ec10 100644 --- a/share/functions/__fish_systemctl_service_paths.fish +++ b/share/functions/__fish_systemctl_service_paths.fish @@ -1,4 +1,5 @@ function __fish_systemctl_service_paths - command find /etc/systemd/system -type f -name '*.path' -printf '%f\n' - command find /usr/lib/systemd/system -type f -name '*.path' -printf '%f\n' + if type -q systemctl + systemctl list-unit-files --no-legend --type=path ^/dev/null | cut -f 1 -d ' ' + end end |