2019-12-03 18:15:33 +08:00
|
|
|
function __fish_print_debian_services --description 'Prints services installed'
|
2023-01-26 03:04:57 +08:00
|
|
|
path filter -fxZ /etc/init.d/* | path basename
|
2019-12-03 18:15:33 +08:00
|
|
|
end
|
2009-02-05 03:17:57 +08:00
|
|
|
|
|
|
|
function __fish_invoke_rcd_has_service
|
2024-01-22 14:42:45 +08:00
|
|
|
set -l tokens (commandline -xpc)
|
2021-11-23 21:45:28 +08:00
|
|
|
if test (count $tokens) -eq 2
|
2019-05-05 18:53:09 +08:00
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
end
|
2009-02-05 03:17:57 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
complete -f -c invoke-rc.d -n 'not __fish_invoke_rcd_has_service' -a '(__fish_print_debian_services)'
|
2020-03-10 02:36:12 +08: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'
|