You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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