2012-11-01 01:47:13 +00:00
|
|
|
#compdef rebar
|
|
|
|
|
|
|
|
local curcontext=$curcontext state ret=1
|
|
|
|
typeset -ga _rebar_global_opts
|
|
|
|
|
|
|
|
_rebar_global_opts=(
|
|
|
|
'(--help -h)'{--help,-h}'[Show the program options]'
|
|
|
|
'(--commands -c)'{--commands,-c}'[Show available commands]'
|
|
|
|
'(--version -V)'{--version,-V}'[Show version information]'
|
2013-10-12 20:12:40 +00:00
|
|
|
'(-vv -v)'--verbose'[Enforce verbosity level]'
|
|
|
|
'(-vv)-v[Slightly more verbose output]'
|
|
|
|
'(-v)-vv[More verbose output]'
|
|
|
|
'(-vv -v --verbose)'{--quiet,-q}'[Quiet, only print error messages]'
|
2012-11-01 01:47:13 +00:00
|
|
|
'(--force -f)'{--force,-f}'[Force]'
|
|
|
|
'-D+[Define compiler macro]'
|
|
|
|
'(--jobs -j)'{--jobs+,-j+}'[Number of concurrent workers a command may use. Default: 3]:workers:(1 2 3 4 5 6 7 8 9)'
|
|
|
|
'(--config -C)'{--config,-C}'[Rebar config file to use]:files:_files'
|
|
|
|
'(--profile -p)'{--profile,-p}'[Profile this run of rebar]'
|
|
|
|
'(--keep-going -k)'{--keep-going,-k}'[Keep running after a command fails]'
|
2012-11-05 19:08:48 +00:00
|
|
|
'(--recursive -r)'{--recursive,-r}'[Apply commands to subdirs and dependencies]'
|
2012-11-01 01:47:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
_rebar () {
|
|
|
|
_arguments -C $_rebar_global_opts \
|
|
|
|
'*::command and variable:->cmd_and_var' \
|
|
|
|
&& return
|
|
|
|
|
|
|
|
case $state in
|
|
|
|
cmd_and_var)
|
|
|
|
_values -S = 'variables' \
|
|
|
|
'clean[Clean]' \
|
|
|
|
'compile[Compile sources]' \
|
|
|
|
'create[Create skel based on template and vars]' \
|
|
|
|
'create-app[Create simple app skel]' \
|
2013-12-19 22:01:25 +00:00
|
|
|
'create-lib[Create simple lib skel]' \
|
2012-11-01 01:47:13 +00:00
|
|
|
'create-node[Create simple node skel]' \
|
|
|
|
'list-template[List avaiavle templates]' \
|
|
|
|
'doc[Generate Erlang program documentation]' \
|
|
|
|
'check-deps[Display to be fetched dependencies]' \
|
2012-11-05 19:08:48 +00:00
|
|
|
'prepare-deps[Fetch and build dependencies]' \
|
|
|
|
'refresh-deps[Update and build dependencies]' \
|
2012-11-01 01:47:13 +00:00
|
|
|
'get-deps[Fetch dependencies]' \
|
|
|
|
'update-deps[Update fetched dependencies]' \
|
|
|
|
'delete-deps[Delete fetched dependencies]' \
|
|
|
|
'list-deps[List dependencies]' \
|
|
|
|
'generate[Build release with reltool]' \
|
|
|
|
'overlay[Run reltool overlays only]' \
|
|
|
|
'generate-appups[Generate appup files]' \
|
|
|
|
'generate-upgrade[Build an upgrade package]' \
|
2012-11-15 08:43:15 +00:00
|
|
|
'escriptize[Create stand-alone escript executable]' \
|
2012-11-01 01:47:13 +00:00
|
|
|
'eunit[Run eunit tests]' \
|
|
|
|
'ct[Run common_test suites]' \
|
|
|
|
'qc[Test QuickCheck properties]' \
|
|
|
|
'xref[Run cross reference analysis]' \
|
|
|
|
'help[Show the program options]' \
|
|
|
|
'version[Show version information]' \
|
2012-11-01 10:58:38 +00:00
|
|
|
'apps[Application names to process]:' \
|
|
|
|
'case[Common Test case]:' \
|
2012-11-30 16:30:48 +00:00
|
|
|
'dump_spec[Dump reltool spec]::flag:(1)' \
|
2012-11-01 01:47:13 +00:00
|
|
|
'jobs[Number of workers]::workers:(0 1 2 3 4 5 6 7 8 9)' \
|
2012-11-01 10:58:38 +00:00
|
|
|
'suites[Common Test suites]::suite name:_path_files -W "(src test)" -g "*.erl(:r)"' \
|
2012-11-01 01:47:13 +00:00
|
|
|
'verbose[Verbosity level]::verbosity level:(0 1 2 3)' \
|
|
|
|
'appid[Application id]:' \
|
2012-12-02 15:04:07 +00:00
|
|
|
'overlay_vars[Overlay variables file]:' \
|
2012-11-01 10:58:38 +00:00
|
|
|
'previous_release[Previous release path]:' \
|
2014-08-02 13:37:28 +00:00
|
|
|
'profiler[Select profiler]::flag:(fprof eflame)' \
|
2012-11-01 01:47:13 +00:00
|
|
|
'nodeid[Node id]:' \
|
2012-11-01 10:58:38 +00:00
|
|
|
'root_dir[Reltool config root directory]::directory:_files -/' \
|
|
|
|
'skip_deps[Skip deps]::flag:(true false)' \
|
|
|
|
'skip_apps[Application names to not process]::flag:(true false)' \
|
2012-12-02 15:04:07 +00:00
|
|
|
'target_dir[Target directory]:' \
|
2012-11-01 10:58:38 +00:00
|
|
|
'template[Template name]:' \
|
2012-11-01 01:47:13 +00:00
|
|
|
'template_dir[Template directory]::directory:_files -/' \
|
2012-12-02 15:04:07 +00:00
|
|
|
'tests[Run eunit tests whose name starts with given string]:' \
|
2012-11-01 01:47:13 +00:00
|
|
|
&& ret=0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
_rebar
|
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
|
|
|
# sh-basic-offset: 2
|
|
|
|
# sh-indent-comment: t
|
|
|
|
# indent-tabs-mode: nil
|
|
|
|
# End:
|
|
|
|
# ex: sw=2 ts=2 et filetype=sh
|