_rebar 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #compdef rebar
  2. local curcontext=$curcontext state ret=1
  3. typeset -ga _rebar_global_opts
  4. _rebar_global_opts=(
  5. '(--help -h)'{--help,-h}'[Show the program options]'
  6. '(--commands -c)'{--commands,-c}'[Show available commands]'
  7. '(--version -V)'{--version,-V}'[Show version information]'
  8. '(-vvv -vv -v)'--verbose+'[Verbosity level. Default: 0]:verbosity level:(0 1 2 3)'
  9. '(-vvv)-v[Slightly more verbose output]'
  10. '(-vvv)-vv[More verbose output]'
  11. '(-v -vv)-vvv[Most verbose output]'
  12. '(--force -f)'{--force,-f}'[Force]'
  13. '-D+[Define compiler macro]'
  14. '(--jobs -j)'{--jobs+,-j+}'[Number of concurrent workers a command may use. Default: 3]:workers:(1 2 3 4 5 6 7 8 9)'
  15. '(--config -C)'{--config,-C}'[Rebar config file to use]:files:_files'
  16. '(--profile -p)'{--profile,-p}'[Profile this run of rebar]'
  17. '(--keep-going -k)'{--keep-going,-k}'[Keep running after a command fails]'
  18. )
  19. _rebar () {
  20. _arguments -C $_rebar_global_opts \
  21. '*::command and variable:->cmd_and_var' \
  22. && return
  23. case $state in
  24. cmd_and_var)
  25. _values -S = 'variables' \
  26. 'clean[Clean]' \
  27. 'compile[Compile sources]' \
  28. 'create[Create skel based on template and vars]' \
  29. 'create-app[Create simple app skel]' \
  30. 'create-node[Create simple node skel]' \
  31. 'list-template[List available templates]' \
  32. 'doc[Generate Erlang program documentation]' \
  33. 'check-deps[Display to be fetched dependencies]' \
  34. 'get-deps[Fetch dependencies]' \
  35. 'update-deps[Update fetched dependencies]' \
  36. 'delete-deps[Delete fetched dependencies]' \
  37. 'list-deps[List dependencies]' \
  38. 'generate[Build release with reltool]' \
  39. 'overlay[Run reltool overlays only]' \
  40. 'generate-appups[Generate appup files]' \
  41. 'generate-upgrade[Build an upgrade package]' \
  42. 'eunit[Run eunit tests]' \
  43. 'ct[Run common_test suites]' \
  44. 'qc[Test QuickCheck properties]' \
  45. 'xref[Run cross reference analysis]' \
  46. 'help[Show the program options]' \
  47. 'version[Show version information]' \
  48. 'apps[Application names to process]:' \
  49. 'case[Common Test case]:' \
  50. 'dump_spec[Dump reltool spec]:' \
  51. 'jobs[Number of workers]::workers:(0 1 2 3 4 5 6 7 8 9)' \
  52. 'suites[Common Test suites]::suite name:_path_files -W "(src test)" -g "*.erl(:r)"' \
  53. 'verbose[Verbosity level]::verbosity level:(0 1 2 3)' \
  54. 'appid[Application id]:' \
  55. 'previous_release[Previous release path]:' \
  56. 'nodeid[Node id]:' \
  57. 'root_dir[Reltool config root directory]::directory:_files -/' \
  58. 'skip_deps[Skip deps]::flag:(true false)' \
  59. 'skip_apps[Application names to not process]::flag:(true false)' \
  60. 'template[Template name]:' \
  61. 'template_dir[Template directory]::directory:_files -/' \
  62. && ret=0
  63. ;;
  64. esac
  65. }
  66. _rebar
  67. # Local variables:
  68. # mode: shell-script
  69. # sh-basic-offset: 2
  70. # sh-indent-comment: t
  71. # indent-tabs-mode: nil
  72. # End:
  73. # ex: sw=2 ts=2 et filetype=sh