.bin
.config
.local
.ncmpcpp
.oh-my-zsh
lib
plugins
adb
ant
apache2-macports
arcanist
archlinux
asdf
autoenv
autojump
autopep8
aws
battery
bbedit
bgnotify
boot2docker
bower
branch
brew
bundler
bwana
cabal
cake
cakephp3
capistrano
cargo
cask
catimg
celery
chruby
chucknorris
cloudapp
codeclimate
_codeclimate
coffee
colemak
colored-man-pages
colorize
command-not-found
common-aliases
compleat
composer
copybuffer
copydir
copyfile
cp
cpanm
debian
dircycle
dirhistory
dirpersist
django
dnf
docker
docker-compose
dotenv
droplr
emacs
ember-cli
emoji
emoji-clock
emotty
encode64
extract
fabric
fancy-ctrl-z
fasd
fastfile
fbterm
fedora
firewalld
forklift
fossil
frontend-search
gas
gb
geeknote
gem
git
git-extras
git-flow
git-flow-avh
git-hubflow
git-prompt
git-remote-branch
gitfast
github
gitignore
glassfish
globalias
gnu-utils
go
golang
gpg-agent
gradle
grails
grunt
gulp
heroku
history
history-substring-search
httpie
iwhois
jake-node
jhbuild
jira
jruby
jsontools
jump
kate
kitchen
knife
knife_ssh
kubectl
laravel
laravel4
laravel5
last-working-dir
lein
lighthouse
lol
macports
man
marked2
mercurial
meteor
mix
mix-fast
mosh
mvn
mysql-macports
n98-magerun
nanoc
ng
nmap
node
nomad
npm
nvm
nyan
osx
pass
paver
pep8
per-directory-history
perl
perms
phing
pip
pj
pod
postgres
pow
powder
powify
profiles
pyenv
pylint
python
rails
rake
rake-fast
rand-quote
rbenv
rbfu
react-native
rebar
redis-cli
repo
rsync
ruby
rust
rvm
safe-paste
sbt
scala
scd
screen
scw
sfffe
shrink-path
singlechar
spring
sprunge
ssh-agent
stack
sublime
sudo
supervisor
suse
svn
svn-fast-info
swiftpm
symfony
symfony2
systemadmin
systemd
taskwarrior
terminalapp
terminitor
terraform
textastic
textmate
thefuck
themes
thor
tig
tmux
tmux-cssh
tmuxinator
torrent
tugboat
ubuntu
urltools
vagrant
vault
vi-mode
vim-interaction
virtualenv
virtualenvwrapper
vundle
wakeonlan
wd
web-search
wp-cli
xcode
yarn
yii
yii2
yum
z
zeus
zsh-navigation-tools
zsh_reload
templates
themes
tools
CONTRIBUTING.md
LICENSE.txt
README.md
oh-my-zsh.sh
.themes
.vim
.Xdefaults
.Xresources
.bash_profile
.bashrc
.profile
.vimrc
.xinitrc
.xsessionrc
.zshrc
README.md
83 lines
2.4 KiB
Plaintext
83 lines
2.4 KiB
Plaintext
#compdef codeclimate
|
|
|
|
_codeclimate_all_engines() {
|
|
engines_all=(`codeclimate engines:list | tail -n +2 | gawk '{ print $2 }' | gawk -F: '{ print $1 }'`)
|
|
}
|
|
|
|
_codeclimate_installed_engines() {
|
|
_codeclimate_all_engines
|
|
|
|
engines_installed=()
|
|
|
|
if [ -e .codeclimate.yml ]
|
|
then
|
|
for engine in $engines_all
|
|
do
|
|
if grep -q $engine ".codeclimate.yml"
|
|
then
|
|
engines_installed+=$engine
|
|
fi
|
|
done
|
|
fi
|
|
}
|
|
|
|
_codeclimate_not_installed_engines() {
|
|
_codeclimate_all_engines
|
|
|
|
engines_not_installed=()
|
|
|
|
if [ -e .codeclimate.yml ]
|
|
then
|
|
for engine in $engines_all
|
|
do
|
|
if ! grep -q $engine ".codeclimate.yml"
|
|
then
|
|
engines_not_installed+=$engine
|
|
fi
|
|
done
|
|
fi
|
|
}
|
|
|
|
local curcontext="$curcontext" state line ret=1
|
|
local expl
|
|
local -a engines_all engines_installed engines_not_installed
|
|
|
|
_arguments \
|
|
'1: :->cmds' \
|
|
'*:: :->args' && ret=0
|
|
|
|
case $state in
|
|
cmds)
|
|
_values "bundle command" \
|
|
"analyze[Analyze all relevant files in the current working directory]" \
|
|
"console[Start an interactive session providing access to the classes within the CLI]" \
|
|
"engines\:disable[Prevents the engine from being used in this project]" \
|
|
"engines\:enable[This engine will be run the next time your project is analyzed]" \
|
|
"engines\:install[Compares the list of engines in your .codeclimate.yml file to those that are currently installed, then installs any missing engines]" \
|
|
"engines\:list[Lists all available engines in the Code Climate Docker Hub]" \
|
|
"engines\:remove[Removes an engine from your .codeclimate.yml file]" \
|
|
"help[Displays a list of commands that can be passed to the Code Climate CLI]" \
|
|
"init[Generates a new .codeclimate.yml file in the current working directory]" \
|
|
"validate-config[Validates the .codeclimate.yml file in the current working directory]" \
|
|
"version[Displays the current version of the Code Climate CLI]"
|
|
ret=0
|
|
;;
|
|
args)
|
|
case $line[1] in
|
|
engines:enable)
|
|
_codeclimate_not_installed_engines
|
|
_wanted engines_not_installed expl 'not installed engines' compadd -a engines_not_installed ;;
|
|
engines:disable|engines:remove)
|
|
_codeclimate_installed_engines
|
|
_wanted engines_installed expl 'installed engines' compadd -a engines_installed ;;
|
|
analyze)
|
|
_arguments \
|
|
'-f:Output Format:(text json)'
|
|
ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
|
|
return ret
|