systemctl completions: Support user-mode

This commit is contained in:
Fabian Homborg 2015-02-19 14:22:21 +01:00 committed by ridiculousfish
parent 388a8d09d8
commit 3e32715693
4 changed files with 28 additions and 12 deletions

View file

@ -1,5 +1,9 @@
function __fish_systemctl_mounts
if type -q systemctl
if __fish_contains_opt user
systemctl --user list-unit-files --no-legend --type=mount ^/dev/null | cut -f 1 -d ' '
else
systemctl list-unit-files --no-legend --type=mount ^/dev/null | cut -f 1 -d ' '
end
end
end

View file

@ -1,5 +1,9 @@
function __fish_systemctl_service_paths
if type -q systemctl
if __fish_contains_opt user
systemctl --user list-unit-files --no-legend --type=path ^/dev/null | cut -f 1 -d ' '
else
systemctl list-unit-files --no-legend --type=path ^/dev/null | cut -f 1 -d ' '
end
end
end

View file

@ -1,5 +1,9 @@
function __fish_systemctl_services
if type -q systemctl
if __fish_contains_opt user
systemctl --user list-unit-files --no-legend --type=service ^/dev/null | cut -f 1 -d ' '
else
systemctl list-unit-files --no-legend --type=service ^/dev/null | cut -f 1 -d ' '
end
end
end

View file

@ -1,5 +1,9 @@
function __fish_systemctl_sockets
if type -q systemctl
if __fish_contains_opt user
systemctl --user list-unit-files --no-legend --type=socket ^/dev/null | cut -f 1 -d ' '
else
systemctl list-unit-files --no-legend --type=socket ^/dev/null | cut -f 1 -d ' '
end
end
end