fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
08a455d4f
master
1function __fish_complete_rc-update_actions 2set -l actions add\ 3'Add the service to the runlevel or the current one if non given' 4set -l actions$actions del\ 5'Delete the service from the runlevel or the current one if non given' 6set -l actions$actions show\ 7'Show all enabled services and the runlevels they belong to' 8printf "%s\t%s\n" $actions 9end 10 11function __fish_complete_rc-update_runlevels 12set -l levels sysinit\ 13'First startup runlevel' \ 14 boot\ 15'Second startup runlevel' \ 16 default\ 17'Last startup runlevel' \ 18 shutdown\ 19'Runlevel for shutting down' 20printf "%s\t%s\n" $levels 21end 22 23# The first argument is what action to take with the service 24complete -c rc-update -n"test (__fish_number_of_cmd_args_wo_opts) = 1" \ 25 -xa"(__fish_complete_rc-update_actions)" 26 27# The second argument is the names of the service, i.e. a file in /etc/init.d 28complete -c rc-update -n"test (__fish_number_of_cmd_args_wo_opts) = 2" \ 29 -xa"(__fish_print_service_names)" -d"Service name" 30 31# The third argument is the names of the service, i.e. a file in /etc/init.d 32complete -c rc-update -n"test (__fish_number_of_cmd_args_wo_opts) = 3" \ 33 -xa"(__fish_complete_rc-update_runlevels)"