abra zsh config 2.0

This commit is contained in:
Andrey Anurin
2018-08-12 15:26:21 +03:00
parent 201abd09c4
commit 6b114440e2
1195 changed files with 68948 additions and 10539 deletions

View File

@@ -1,5 +1,30 @@
#compdef rails
# ------------------------------------------------------------------------------
# Copyright (c) 2016 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.
# ------------------------------------------------------------------------------
# Description
# -----------
#
@@ -54,6 +79,7 @@ __rails_commands() {
profiler'[Get profile information from a piece of code]'
plugin'[Install a plugin]'
{runner,r}'[Run a piece of code in the application environment]'
{test,t}'[Run tests]'
)
else
commands=(
@@ -375,8 +401,8 @@ _rails_generate_scaffold_controller() {
_arguments \
$model_generators_options \
'(-e,--template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:template engine' \
'(-t,--test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \
'(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:template engine' \
'(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \
--helper'[Indicates when to generate helper]: :__rails_boolean' \
': :_guard "^-*" "name"'
}
@@ -445,16 +471,16 @@ _rails_new() {
_arguments -C \
$rails_options \
$runtime_options \
'(-r,--ruby)'{-r,--ruby=}'[Path to the Ruby binary of your choice]:path' \
'(-b,--builder)'{-b,--builder=}'[Path to a application builder (can be a filesystem path or URL)]: :->path_or_url' \
'(-m,--template)'{-m,--template=}'[Path to an application template (can be a filesystem path or URL)]: :->path_or_url' \
'(-r --ruby)'{-r,--ruby=}'[Path to the Ruby binary of your choice]:path' \
'(-b --builder)'{-b,--builder=}'[Path to a application builder (can be a filesystem path or URL)]: :->path_or_url' \
'(-m --template)'{-m,--template=}'[Path to an application template (can be a filesystem path or URL)]: :->path_or_url' \
--skip-gemfile"[Don't create a Gemfile]" \
--skip-bundle"[Don't run bundle install]" \
'(-G,--skip-git)'{-G,--skip-git}'[Skip Git ignores and keeps]' \
'(-O,--skip-active-record)'{-O,--skip-active-record}'[Skip Active Record files]' \
'(-S,--skip-sprockets)'{-S,--skip-sprockets}'[Skip Sprockets files]' \
'(-d,--database)'{-d,--database=}'[Preconfigure for selected database]:database:(mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc)' \
'(-j,--javascript)'{-j,--javascript=}'[Preconfigure for selected JavaScript library]:javascript' \
'(-G --skip-git)'{-G,--skip-git}'[Skip Git ignores and keeps]' \
'(-O --skip-active-record)'{-O,--skip-active-record}'[Skip Active Record files]' \
'(-S --skip-sprockets)'{-S,--skip-sprockets}'[Skip Sprockets files]' \
'(-d --database)'{-d,--database=}'[Preconfigure for selected database]:database:(mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc)' \
'(-j --javascript)'{-j,--javascript=}'[Preconfigure for selected JavaScript library]:javascript' \
'(-J --skip-javascript)'{-J,--skip-javascript}'[Skip JavaScript files]' \
--dev'[Setup the application with Gemfile pointing to your Rails checkout]' \
--edge'[Setup the application with Gemfile pointing to Rails repository]' \
@@ -569,6 +595,24 @@ _rails_r() {
_rails_runner
}
_rails_test() {
local context state line curcontext="$curcontext"
_arguments -C \
': :->path'
case "$state" in
path)
_alternative \
'files:filename:_files -g "*.rb"'
;;
esac
}
_rails_t() {
_rails_test
}
_rails "$@"
# Local Variables: