]> git.rmz.io Git - dotfiles.git/blob - zsh/plugins/bundler/_bundler
add xbindkeysrc
[dotfiles.git] / zsh / plugins / bundler / _bundler
1 #compdef bundle
2
3 local curcontext="$curcontext" state line _gems _opts ret=1
4
5 _arguments -C -A "-v" -A "--version" \
6 '(- 1 *)'{-v,--version}'[display version information]' \
7 '1: :->cmds' \
8 '*:: :->args' && ret=0
9
10 case $state in
11 cmds)
12 _values "bundle command" \
13 "install[Install the gems specified by the Gemfile or Gemfile.lock]" \
14 "update[Update dependencies to their latest versions]" \
15 "package[Package the .gem files required by your application]" \
16 "exec[Execute a script in the context of the current bundle]" \
17 "config[Specify and read configuration options for bundler]" \
18 "check[Determine whether the requirements for your application are installed]" \
19 "list[Show all of the gems in the current bundle]" \
20 "show[Show the source location of a particular gem in the bundle]" \
21 "console[Start an IRB session in the context of the current bundle]" \
22 "open[Open an installed gem in the editor]" \
23 "viz[Generate a visual representation of your dependencies]" \
24 "init[Generate a simple Gemfile, placed in the current directory]" \
25 "gem[Create a simple gem, suitable for development with bundler]" \
26 "help[Describe available tasks or one specific task]"
27 ret=0
28 ;;
29 args)
30 case $line[1] in
31 help)
32 _values 'commands' \
33 'install' \
34 'update' \
35 'package' \
36 'exec' \
37 'config' \
38 'check' \
39 'list' \
40 'show' \
41 'console' \
42 'open' \
43 'viz' \
44 'init' \
45 'gem' \
46 'help' && ret=0
47 ;;
48 install)
49 _arguments \
50 '(--no-color)--no-color[disable colorization in output]' \
51 '(--local)--local[do not attempt to connect to rubygems.org]' \
52 '(--quiet)--quiet[only output warnings and errors]' \
53 '(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
54 '(--system)--system[install to the system location]' \
55 '(--deployment)--deployment[install using defaults tuned for deployment environments]' \
56 '(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
57 '(--path)--path=-[specify a different path than the system default]:path:_files' \
58 '(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
59 '(--without)--without=-[exclude gems that are part of the specified named group]:groups'
60 ret=0
61 ;;
62 exec)
63 _normal && ret=0
64 ;;
65 (open|show)
66 _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
67 if [[ $_gems != "" ]]; then
68 _values 'gems' $_gems && ret=0
69 fi
70 ;;
71 *)
72 _opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
73 _opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
74 if [[ $_opts != "" ]]; then
75 _values 'options' $_opts && ret=0
76 fi
77 ;;
78 esac
79 ;;
80 esac
81
82 return ret