22da0a00b8a05652c08ba6744962c572746462ae

Author
goofansu <goofan.su@gmail.com>
Committer
goofansu <goofan.su@gmail.com>
Date

Message

Add rebar to plugin

Diff

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