2019-12-03 10:15:33 +00:00
|
|
|
function __fish_print_debian_services --description 'Prints services installed'
|
|
|
|
for service in /etc/init.d/*
|
|
|
|
if [ -x $service ]
|
|
|
|
basename $service
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2009-02-04 19:17:57 +00:00
|
|
|
|
|
|
|
function __fish_invoke_rcd_has_service
|
2020-05-15 05:56:06 +00:00
|
|
|
set -l tokens (commandline -opc)
|
2019-05-05 10:53:09 +00:00
|
|
|
if [ (count $tokens) -eq 2 ]
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
end
|
2009-02-04 19:17:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
complete -f -c invoke-rc.d -n 'not __fish_invoke_rcd_has_service' -a '(__fish_print_debian_services)'
|
2020-03-09 18:36:12 +00:00
|
|
|
complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a start -d 'Start the service'
|
|
|
|
complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a stop -d 'Stop the service'
|
|
|
|
complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a restart -d 'Restart the service'
|
|
|
|
complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a reload -d 'Reload Configuration'
|
|
|
|
complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a force-reload -d 'Force reloading configuration'
|
|
|
|
complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a status -d 'Print the status of the service'
|