fish-shell/share/completions/rc-service.fish
Jelte Fennema 44d13869ad Add eselect, rc-update and rc-service completions. (These are utilities used by Gentoo Linux)
Disable php completion for the 4th part of the command, since php-eselect is differently designed and causes errors

Closes #1131.
2013-11-27 18:36:05 +08:00

21 lines
1.1 KiB
Fish

# First argument is the names of the service, i.e. a file in /etc/init.d
complete -c rc-service -n "test (__fish_number_of_cmd_args_wo_opts) = 1" \
-xa "(__fish_print_service_names)" --description "Service name"
# The second argument is what action to take with the service
complete -c rc-service -n "test (__fish_number_of_cmd_args_wo_opts) -gt 1" \
-xa "(__fish_complete_service_actions)"
# Complete rc-service the options
complete -c rc-service -s e -l exists -d 'Tests if the service exists or not'
complete -c rc-service -s i -l ifexists \
-d 'If the service exists, then run the command'
complete -c rc-service -s l -l list -d 'List all available services'
complete -c rc-service -s r -l resolve \
-d 'Resolve the service name to an init script'
complete -c rc-service -s h -l help -d 'Display the help output'
complete -c rc-service -s C -l nocolor -d 'Disable color output'
complete -c rc-service -s V -l version -d 'Display software version'
complete -c rc-service -s v -l verbose -d 'Run verbosely'
complete -c rc-service -s q -l quiet -d 'Run quietly (Does not affect errors)'