/bash_completion_lib/complete -o filenames/reportbug

http://github.com/brinkman83/bashrc · #! · 76 lines · 67 code · 9 blank · 0 comment · 0 complexity · 1459473693cdcd02c4598fb13c4d2213 MD5 · raw file

  1. # Debian reportbug(1) completion
  2. comp_include _command _filedir _get_cword
  3. _reportbug()
  4. {
  5. local cur prev
  6. COMPREPLY=()
  7. cur=`_get_cword`
  8. prev=${COMP_WORDS[COMP_CWORD-1]}
  9. case "$prev" in
  10. -f|--filename|-i|--include|--mta|-o|--output)
  11. _filedir
  12. return 0
  13. ;;
  14. -B|--bts)
  15. COMPREPLY=( $( compgen -W "debian guug kde mandrake help" -- \
  16. $cur ))
  17. return 0
  18. ;;
  19. -e|--editor|--mua)
  20. COMP_WORDS=(COMP_WORDS[0] $cur)
  21. COMP_CWORD=1
  22. _command
  23. return 0
  24. ;;
  25. --mode)
  26. COMPREPLY=( $( compgen -W "novice standard expert" -- $cur ) )
  27. return 0
  28. ;;
  29. -S|--severity)
  30. COMPREPLY=( $( compgen -W "grave serious important normal \
  31. minor wishlist" -- $cur ) )
  32. return 0
  33. ;;
  34. -u|--ui|--interface)
  35. COMPREPLY=( $( compgen -W "newt text gnome" -- $cur ) )
  36. return 0
  37. ;;
  38. -t|--type)
  39. COMPREPLY=( $( compgen -W "gnats debbugs" -- $cur ) )
  40. return 0
  41. ;;
  42. -T|--tags)
  43. COMPREPLY=( $( compgen -W "none patch security upstream sid \
  44. woody potato sarge fixed" -- $cur ))
  45. return 0
  46. ;;
  47. *)
  48. ;;
  49. esac
  50. COMPREPLY=($( compgen -W '-h --help -v --version -a --af -b \
  51. --no-query-bts --query-bts -B --bts -c --configure \
  52. --no-config-files --check-available -d --debug \
  53. --no-check-available -e --editor --email -f \
  54. --filename -g --gnupg -H --header -i --include -j \
  55. --justification -l --ldap --no-ldap -L --list-cc -m \
  56. --maintonly --mode --mua --mta --mutt -n --mh --nmh \
  57. -o --output -p --print -P --pgp --proxy --http_proxy\
  58. -q --quiet -Q --query-only --realname --report-quiet \
  59. --reply-to --replyto -s --subject -S --severity \
  60. --smtphost -t --type -T --tags --template -V -x \
  61. --no-cc --package-version -z --no-compress \
  62. --ui --interface -u \
  63. wnpp boot-floppies kernel-image' -- $cur ) \
  64. $( apt-cache pkgnames -- $cur 2> /dev/null ) )
  65. _filedir
  66. return 0
  67. } # _reportbug()