mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 11:43:37 +08:00
9367d4ff71
This does not include checks/function.fish because that currently includes a "; end" in a message that indent would remove, breaking the test.
25 lines
1.0 KiB
Fish
25 lines
1.0 KiB
Fish
function __fish_print_debian_services --description 'Prints services installed'
|
|
for service in /etc/init.d/*
|
|
if [ -x $service ]
|
|
basename $service
|
|
end
|
|
end
|
|
end
|
|
|
|
function __fish_invoke_rcd_has_service
|
|
set tokens (commandline -opc)
|
|
if [ (count $tokens) -eq 2 ]
|
|
return 0
|
|
else
|
|
return 1
|
|
end
|
|
end
|
|
|
|
complete -f -c invoke-rc.d -n 'not __fish_invoke_rcd_has_service' -a '(__fish_print_debian_services)'
|
|
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'
|