_invoke-rc.d 932 B

12345678910111213141516171819202122232425262728293031
  1. #compdef invoke-rc.d
  2. local state ret=-1
  3. _arguments -C \
  4. '(- 1 *)--help[display usage help]' \
  5. '--quiet[quiet mode, no error messages displayed]' \
  6. '--try-anyway[try to run script while non-fatal error is detected]' \
  7. '--disclose-deny[return status code 101 instead of 0 if the script action is denied]' \
  8. '--query[returns one of the status codes 100-106. Does not run the init script]' \
  9. '--no-fallback[ignore any fallback action requests by the policy]' \
  10. '--force[try to run the init script regardless of policy and errors]' \
  11. '1:service:_services' \
  12. '2:service action:->saction' \
  13. '*::arguments _normal' \
  14. && ret=0
  15. case $state in
  16. saction)
  17. case $words[CURRENT-1] in
  18. --*)
  19. ;;
  20. *)
  21. actions=($(sed -ne "y/|/ /; s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" /etc/init.d/$words[CURRENT-1]))
  22. _wanted actions expl actions compadd $actions
  23. ;;
  24. esac
  25. ;;
  26. esac
  27. return ret