3 _codeclimate_all_engines() {
4 engines_all=(`codeclimate engines:list | tail -n +2 | gawk '{ print $2 }' | gawk -F: '{ print $1 }'`)
7 _codeclimate_installed_engines() {
8 _codeclimate_all_engines
12 if [ -e .codeclimate.yml ]
14 for engine in $engines_all
16 if grep -q $engine ".codeclimate.yml"
18 engines_installed+=$engine
24 _codeclimate_not_installed_engines() {
25 _codeclimate_all_engines
27 engines_not_installed=()
29 if [ -e .codeclimate.yml ]
31 for engine in $engines_all
33 if ! grep -q $engine ".codeclimate.yml"
35 engines_not_installed+=$engine
41 local curcontext="$curcontext" state line ret=1
43 local -a engines_all engines_installed engines_not_installed
47 '*:: :->args' && ret=0
51 _values "bundle command" \
52 "analyze[Analyze all relevant files in the current working directory]" \
53 "console[Start an interactive session providing access to the classes within the CLI]" \
54 "engines\:disable[Prevents the engine from being used in this project]" \
55 "engines\:enable[This engine will be run the next time your project is analyzed]" \
56 "engines\:install[Compares the list of engines in your .codeclimate.yml file to those that are currently installed, then installs any missing engines]" \
57 "engines\:list[Lists all available engines in the Code Climate Docker Hub]" \
58 "engines\:remove[Removes an engine from your .codeclimate.yml file]" \
59 "help[Displays a list of commands that can be passed to the Code Climate CLI]" \
60 "init[Generates a new .codeclimate.yml file in the current working directory]" \
61 "validate-config[Validates the .codeclimate.yml file in the current working directory]" \
62 "version[Displays the current version of the Code Climate CLI]"
68 _codeclimate_not_installed_engines
69 _wanted engines_not_installed expl 'not installed engines' compadd -a engines_not_installed ;;
70 engines:disable|engines:remove)
71 _codeclimate_installed_engines
72 _wanted engines_installed expl 'installed engines' compadd -a engines_installed ;;
75 '-f:Output Format:(text json)'