aboutsummaryrefslogtreecommitdiffstats
path: root/src/_rails
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2023-09-28 16:12:26 +0900
committerShohei YOSHIDA <syohex@gmail.com>2023-09-28 16:12:26 +0900
commit1a9467fdffc88b3406570f2d156c62604da7d3ea (patch)
tree5b16fbcfd6a6a59cc2bd3f28d0d657eb9a54276c /src/_rails
parentUpdate console and server completions (diff)
downloadzsh-completions-1a9467fdffc88b3406570f2d156c62604da7d3ea.tar
zsh-completions-1a9467fdffc88b3406570f2d156c62604da7d3ea.tar.gz
zsh-completions-1a9467fdffc88b3406570f2d156c62604da7d3ea.tar.bz2
zsh-completions-1a9467fdffc88b3406570f2d156c62604da7d3ea.tar.lz
zsh-completions-1a9467fdffc88b3406570f2d156c62604da7d3ea.tar.xz
zsh-completions-1a9467fdffc88b3406570f2d156c62604da7d3ea.tar.zst
zsh-completions-1a9467fdffc88b3406570f2d156c62604da7d3ea.zip
Update generate and destroy completions
Diffstat (limited to 'src/_rails')
-rw-r--r--src/_rails38
1 files changed, 14 insertions, 24 deletions
diff --git a/src/_rails b/src/_rails
index 93f42ee..71c07a5 100644
--- a/src/_rails
+++ b/src/_rails
@@ -66,9 +66,9 @@ _rails() {
(command)
case $words[1] in
(new)
- __rails_new && ret=0
+ _rails_new && ret=0
;;
- (generate|g)
+ (generate|g|destroy|d)
_rails_generate && ret=0
;;
(console|c)
@@ -95,6 +95,17 @@ _rails() {
'(--log-to-stdout --no-log-to-stdout)--no-log-to-stdout[Not log to stdout]' \
&& ret=0
;;
+ (dbconsole|db)
+ _arguments \
+ '(- *)'{-h,--help}'[Show this help message and quit]' \
+ '(-e --environment)'{-e,--environment=}'[The environment to run "server" in]:env:(test development production)' \
+ '(-p --include-password)'{-p,--include-password}'[Automatically provide the password from database.yml]' \
+ '--mode=[Automatically put the sqlite3 database in the specified mode]:mode:(html list line column)' \
+ '(--header --no-header)--header[Display header]' \
+ '(--header --no-header)--no-header[Not display header]' \
+ '(--db --database)'{--db=,--database=}'[Specify the database to use]:database:_files' \
+ && ret=0
+ ;;
esac
;;
esac
@@ -119,7 +130,7 @@ _rails_subcommands() {
{console,c}'[Start the Rails console]'
{server,s}'[Start the Rails server]'
{dbconsole,db}'[Start a console for the database specified in config/database.yml]'
- {destroy,d}'[Undo code generated with "generate"]'
+ {destroy,d}'[Remove code generated by "bin/rails generates"]'
plugin'[Install a plugin]'
{runner,r}'[Run a piece of code in the application environment]'
{test,t}'[Run tests]'
@@ -389,27 +400,6 @@ __rails_migration_fields() {
fi
}
-_rails_dbconsole() {
- _arguments \
- '(- *)'--help'[Show this help message]' \
- '(-p --include-password)'{-p,--include-password}'[Automatically provide the password from database.yml]' \
- --mode'[Automatically put the sqlite3 database in the specified mode (html, list, line, column)]:mode:(html list line column)' \
- --header
-}
-
-
-_rails_db() {
- _rails_dbconsole
-}
-
-_rails_destroy() {
- _rails_generate
-}
-
-_rails_d() {
- _rails_destroy
-}
-
_rails_plugin() {
local context state line curcontext="$curcontext"