mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
__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:
parent
f2447c537e
commit
00e0ed64bc
4 changed files with 12 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
function __fish_systemctl_sockets
|
||||
command find /etc/systemd/system -type f -name '*.socket' -printf '%f\n'
|
||||
command find /usr/lib/systemd/system -type f -name '*.socket' -printf '%f\n'
|
||||
if type -q systemctl
|
||||
systemctl list-unit-files --no-legend --type=socket ^/dev/null | cut -f 1 -d ' '
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue