dog.bash 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. _dog()
  2. {
  3. cur=${COMP_WORDS[COMP_CWORD]}
  4. prev=${COMP_WORDS[COMP_CWORD-1]}
  5. case "$prev" in
  6. -'?'|--help|-v|--version)
  7. return
  8. ;;
  9. -t|--type)
  10. COMPREPLY=( $( compgen -W 'A AAAA CAA CNAME HINFO MX NS PTR SOA SRV TXT' -- "$cur" ) )
  11. return
  12. ;;
  13. --edns)
  14. COMPREPLY=( $( compgen -W 'disable hide show' -- "$cur" ) )
  15. return
  16. ;;
  17. -Z)
  18. COMPREPLY=( $( compgen -W 'aa ad bufsize= cd' -- "$cur" ) )
  19. return
  20. ;;
  21. --class)
  22. COMPREPLY=( $( compgen -W 'IN CH HS' -- "$cur" ) )
  23. return
  24. ;;
  25. --color|--colour)
  26. COMPREPLY=( $( compgen -W 'always automatic never' -- $cur ) )
  27. return
  28. ;;
  29. esac
  30. case "$cur" in
  31. -*)
  32. COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
  33. return
  34. ;;
  35. *)
  36. COMPREPLY=( $( compgen -W 'A AAAA CAA CNAME HINFO MX NS PTR SOA SRV TXT' -- "$cur" ) )
  37. ;;
  38. esac
  39. } &&
  40. complete -o bashdefault -F _dog dog