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.

86 rivejä
1.8 KiB

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