/bash_completion.d/apache2ctl

http://github.com/brinkman83/bashrc · #! · 24 lines · 19 code · 5 blank · 0 comment · 0 complexity · f9ac67716e338399fcc2531c09dfeffd MD5 · raw file

  1. # apache2ctl(1) completion
  2. have apache2ctl && {
  3. _apache2ctl() {
  4. local APWORDS
  5. COMPREPLY=()
  6. cur=`_get_cword`
  7. APWORDS=$(apache2ctl 2>&1 >/dev/null | head -n1 | cut -f3 -d" " | \
  8. tr "|" " ")
  9. COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) )
  10. }
  11. complete -F _apache2ctl apache2ctl
  12. }
  13. # Local variables:
  14. # mode: shell-script
  15. # sh-basic-offset: 4
  16. # sh-indent-comment: t
  17. # indent-tabs-mode: nil
  18. # End:
  19. # ex: ts=4 sw=4 et filetype=sh