mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 04:58:57 +00:00
adds completion for Debian's invoke-rc.d command
Ignore-this: f9ff385e3c239cedfbc9850b06822bba darcs-hash:20090204191757-69c1e-a55c2a720fd784c7be2534feacecd5e2ebdbeecd.gz
This commit is contained in:
parent
dfd70057b3
commit
c08c313c0a
2 changed files with 25 additions and 0 deletions
18
share/completions/invoke-rc.d.fish
Normal file
18
share/completions/invoke-rc.d.fish
Normal file
|
@ -0,0 +1,18 @@
|
|||
|
||||
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'
|
||||
|
7
share/functions/__fish_print_debian_services.fish
Normal file
7
share/functions/__fish_print_debian_services.fish
Normal file
|
@ -0,0 +1,7 @@
|
|||
function __fish_print_debian_services --description 'Prints services installed'
|
||||
for service in /etc/init.d/*
|
||||
if [ -x $service ]
|
||||
basename $service
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue