zsh-completions/src/_rubocop

84 lines
4.0 KiB
Plaintext
Raw Normal View History

2014-05-26 06:18:09 +00:00
#compdef rubocop
# ------------------------------------------------------------------------------
2015-05-25 04:32:35 +00:00
# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
2014-05-26 06:18:09 +00:00
# Description
# -----------
#
# Completion script for rubocop (https://github.com/bbatsov/rubocop)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Akira Maeda <https://github.com/glidenote>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_rubocop_format_params() {
_values \
2014-05-28 15:50:20 +00:00
'FORMATTER' \
2014-05-26 06:18:09 +00:00
'progress' \
'simple' \
'clang' \
2014-05-28 15:50:20 +00:00
'disabled' \
'fuubar' \
'emacs' \
2014-05-26 06:18:09 +00:00
'json' \
'files' \
2015-05-25 04:32:35 +00:00
'offenses'
2014-05-26 06:18:09 +00:00
}
_arguments -C \
2014-05-28 15:50:20 +00:00
'(--only)--only[Run only the given cop(s)]' \
2014-05-26 06:18:09 +00:00
'(-c --config)'{-c,--config}'[Specify configuration file]' \
'(--auto-gen-config)--auto-gen-config[Generate a configuration file acting as a TODO list]' \
2014-05-28 15:50:20 +00:00
'(--force-exclusion)--force-exclusion[Force excluding files specified in the configuration `Exclude` even if they are explicitly passed as arguments]' \
'(-f --format)'{-f,--format}'[Choose an output formatter.]:FORMATTER:_rubocop_format_params' \
2014-05-26 06:18:09 +00:00
'(-o --out)'{-o,--out}'[Write output to a file instead of STDOUT]' \
'(-r --require)'{-r,--require}'[Require Ruby file.]' \
2014-05-28 15:50:20 +00:00
'(--fail-level)--fail-level[Minimum severity for exit with error code.]' \
'(--show-cops)--show-cops[Shows the given cops, or all cops by default, and their configurations for the current directory.]' \
'(-F --fail-fast)'{-f,--fail-fast}'[Inspect files in order of modification time ant stop after the first file containing offenses]' \
2014-05-26 06:18:09 +00:00
'(-d --debug)'{-d,--debug}'[Display debug info]' \
2015-06-08 07:05:14 +00:00
'(-D --display-cop-names)'{-D,--display-cop-names}'[Display cop names in offense messages.]' \
2014-05-26 06:18:09 +00:00
'(-R --rails)'{-R,--rails}'[Run extra Rails cops.]' \
'(-l --lint)'{-l,--lint}'[Run only lint cops.]' \
2015-06-08 07:05:14 +00:00
'(-a --auto-correct)'{-a,--auto-correct}'[Auto-correct offenses.]' \
2014-05-26 06:18:09 +00:00
'(-n --no-color)'{-n,--no-color}'[Disable color output.]' \
'(-v --version)'{-v,--version}'[Disable version.]' \
'(-V --verbose-version)'{-V,--verbose-version}'[Disable verbose version.]' \
'(-h --help)'{-h,--help}'[Show help.]' \
'*: :_files' && ret=0
return ret