/bash_completion_lib/complete/postfix

http://github.com/brinkman83/bashrc · #! · 28 lines · 24 code · 4 blank · 0 comment · 0 complexity · f0e4d1c7c120091957b19bb8cb13a91c MD5 · raw file

  1. # Postfix completion.
  2. #
  3. comp_include _filedir _get_cword
  4. _postfix()
  5. {
  6. local cur prev
  7. cur=`_get_cword`
  8. prev=${COMP_WORDS[COMP_CWORD-1]}
  9. if [[ $cur == '-' ]]; then
  10. COMPREPLY=(-c -D -v)
  11. return 0
  12. fi
  13. if [[ $prev == '-c' ]]; then
  14. _filedir -d
  15. return 0
  16. fi
  17. if [[ $prev == '-D' ]]; then
  18. COMPREPLY=( $( compgen -W 'start' -- "${COMP_WORDS[COMP_CWORD]}" ) )
  19. return 0
  20. fi
  21. COMPREPLY=( $( compgen -W 'start stop reload abort flush check' -- \
  22. "${COMP_WORDS[COMP_CWORD]}" ) )
  23. }
  24. _postfix