/bash_completion.d/monodevelop

http://github.com/brinkman83/bashrc · #! · 86 lines · 76 code · 10 blank · 0 comment · 0 complexity · 95a5a3d28c05a85d33da92b2bab7febe MD5 · raw file

  1. # Monodevelop completion
  2. have monodevelop &&
  3. _monodevelop()
  4. {
  5. local cur
  6. cur=`_get_cword`
  7. if [[ "$cur" == -* ]]; then
  8. COMPREPLY=( $( compgen -W '-? -help -help2 -ipc-tcp -newwindow -nologo \
  9. -usage -V -version' -- "$cur" ) )
  10. else
  11. _filedir
  12. fi
  13. return 0
  14. } &&
  15. complete -F _monodevelop monodevelop
  16. have mdtool &&
  17. _mdtool()
  18. {
  19. local cur prev command i
  20. COMPREPLY=()
  21. cur=`_get_cword`
  22. prev=${COMP_WORDS[COMP_CWORD-1]}
  23. for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
  24. if [[ ${COMP_WORDS[i]} == @(build|generate-makefiles|setup) ]]; then
  25. command=${COMP_WORDS[i]}
  26. fi
  27. done
  28. if [[ -n "$command" ]]; then
  29. case $command in
  30. "build")
  31. COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \
  32. -S":" -- "$cur" ) )
  33. # TODO: This does not work :(
  34. #if [[ "$prev" == *: ]]; then
  35. # case "$prev" in
  36. # @(--p:|--project:))
  37. # COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
  38. # ;;
  39. # @(--f:|--buildfile:))
  40. # COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) )
  41. # ;;
  42. # esac
  43. #fi
  44. return 0
  45. ;;
  46. "generate-makefiles")
  47. COMPREPLY=( $( compgen $filenames -G"*.mds" -- "$cur" ) )
  48. if [[ "$prev" == *mds ]]; then
  49. COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \
  50. -- "$cur" ) )
  51. fi
  52. return 0
  53. ;;
  54. "setup")
  55. # TODO: at least return filenames after these options.
  56. COMPREPLY=( $( compgen -W 'install i uninstall u check-install \
  57. ci update up list l list-av la list-update lu rep-add ra \
  58. rep-remove rr rep-update ru rep-list rl reg-update \
  59. reg-build rgu info rep-build rb pack p help h dump-file' \
  60. -- "$cur" ) )
  61. return 0
  62. ;;
  63. esac
  64. fi
  65. COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
  66. generate-makefiles gettext-update setup -q' -- "$cur" ) )
  67. return 0
  68. } &&
  69. complete -F _mdtool $filenames mdtool
  70. # Local variables:
  71. # mode: shell-script
  72. # sh-basic-offset: 4
  73. # sh-indent-comment: t
  74. # indent-tabs-mode: nil
  75. # End:
  76. # ex: ts=4 sw=4 et filetype=sh