25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.9 KiB

  1. # bash completion for rebar
  2. _rebar()
  3. {
  4. local cur prev sopts lopts cmdsnvars
  5. COMPREPLY=()
  6. cur="${COMP_WORDS[COMP_CWORD]}"
  7. prev="${COMP_WORDS[COMP_CWORD-1]}"
  8. sopts="-h -c -v -V -f -D -j -C -p -k -r"
  9. lopts="--help \
  10. --commands \
  11. --verbose \
  12. --force \
  13. --jobs \
  14. --config \
  15. --profile \
  16. --keep-going \
  17. --recursive \
  18. --version"
  19. cmdsnvars="check-deps \
  20. clean \
  21. compile \
  22. create \
  23. create-app \
  24. create-lib \
  25. create-node \
  26. ct \
  27. doc \
  28. delete-deps \
  29. escriptize \
  30. eunit \
  31. get-deps \
  32. generate \
  33. generate-appups \
  34. generate-upgrade \
  35. help \
  36. list-deps \
  37. list-templates \
  38. prepare-deps \
  39. qc \
  40. refresh-deps \
  41. update-deps \
  42. version \
  43. xref \
  44. overlay \
  45. apps= \
  46. case= \
  47. dump_spec=1 \
  48. force=1 \
  49. jobs= \
  50. suites= \
  51. verbose=1 \
  52. appid= \
  53. overlay_vars= \
  54. previous_release= \
  55. nodeid= \
  56. root_dir= \
  57. skip_deps=true \
  58. skip_apps= \
  59. target_dir= \
  60. template= \
  61. template_dir= \
  62. tests="
  63. if [[ ${cur} == --* ]] ; then
  64. COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
  65. elif [[ ${cur} == -* ]] ; then
  66. COMPREPLY=( $(compgen -W "${sopts}" -- ${cur}) )
  67. else
  68. COMPREPLY=( $(compgen -W "${cmdsnvars}" -- ${cur}) )
  69. fi
  70. if [ -n "$COMPREPLY" ] ; then
  71. # append space if matched
  72. COMPREPLY="${COMPREPLY} "
  73. # remove trailing space after equal sign
  74. COMPREPLY=${COMPREPLY/%= /=}
  75. fi
  76. return 0
  77. }
  78. complete -o nospace -F _rebar rebar
  79. # Local variables:
  80. # mode: shell-script
  81. # sh-basic-offset: 4
  82. # sh-indent-comment: t
  83. # indent-tabs-mode: nil
  84. # End:
  85. # ex: ts=4 sw=4 et filetype=sh