fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerMerge branch 'completions-to-use-expanded-tokens'a9618477e

master
996 B20 linesraw
1function __fish_print_debian_services --description 'Prints services installed'
2    path filter -fxZ /etc/init.d/* | path basename
3end
4
5function __fish_invoke_rcd_has_service
6    set -l tokens (commandline -xpc)
7    if test (count $tokens) -eq 2
8        return 0
9    else
10        return 1
11    end
12end
13
14complete -f -c invoke-rc.d -n 'not __fish_invoke_rcd_has_service' -a '(__fish_print_debian_services)'
15complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a start -d 'Start the service'
16complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a stop -d 'Stop the service'
17complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a restart -d 'Restart the service'
18complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a reload -d 'Reload Configuration'
19complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a force-reload -d 'Force reloading configuration'
20complete -f -c invoke-rc.d -n __fish_invoke_rcd_has_service -a status -d 'Print the status of the service'