Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
b09890a3
Commit
b09890a3
authored
Jun 30, 2018
by
Justin Aiken
Committed by
Marc Cornellà
Jun 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more levels of zeus compeletion (#2058)
parent
b6ca933a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
23 deletions
+87
-23
_zeus
plugins/zeus/_zeus
+87
-23
No files found.
plugins/zeus/_zeus
View file @
b09890a3
...
@@ -2,33 +2,97 @@
...
@@ -2,33 +2,97 @@
#
autoload
#
autoload
#
in
order
to
make
this
work
,
you
will
need
to
have
the
gem
zeus
installed
#
in
order
to
make
this
work
,
you
will
need
to
have
the
gem
zeus
installed
#
zeus
zsh
completion
# zeus zsh completion, based on adb completion
local
-
a
_1st_arguments
local
-
a
_1st_arguments
_1st_arguments=(
if
[[
-
e
.
zeus
.
sock
]];
then
'console:Lets you interact with your Rails application from the command line. (alias = c)'
_1st_arguments
=(
'cucumber:Runs cucumber.'
'console:Lets you interact with your Rails application from the command line. (alias = c)'
'dbconsole:Figures out which database you are using and drops you into whichever command line interface.'
'cucumber:Runs cucumber.'
'destroy:Figures out what generate did, and undoes it. (alias = d)'
'dbconsole:Figures out which database you are using and drops you into whichever command line interface.'
'generate:Uses templates to create a whole lot of things. (alias = g)'
'destroy:Figures out what generate did, and undoes it. (alias = d)'
'rake:Execute rake tasks.'
'generate:Uses templates to create a whole lot of things. (alias = g)'
'runner:Runs Ruby code in the context of Rails non-interactively. (alias = r)'
'rake:Execute rake tasks.'
'server:Launches a small web server named WEBrick which comes bundled with Ruby. (alias = s)'
'runner:Runs Ruby code in the context of Rails non-interactively. (alias = r)'
'start:Preloads the zeus environment'
'server:Launches a small web server named WEBrick which comes bundled with Ruby. (alias = s)'
'test:Runs RSpec tests. (alias = rspec, testrb)'
'test:Runs RSpec tests. (alias = rspec, testrb)'
'version:Shows the version number.'
'version:Shows the version number.'
)
)
else
_1st_arguments
=(
'start:Preloads the zeus environment'
'init:Generate a zeus.json file'
)
fi
_rails_generate_arguments
()
{
generate_arguments
=(
controller
generator
helper
integration_test
mailer
migration
model
observer
performance_test
plugin
resource
scaffold
scaffold_controller
session_migration
stylesheets
)
}
_rake_does_task_list_need_generating
()
{
if
[
! -f .rake_tasks ]; then return 0;
else
accurate
=$(
stat
-
f
%
m
.
rake_tasks
)
changed
=$(
stat
-
f
%
m
Rakefile
)
return
$(
expr
$
accurate
'>='
$
changed
)
fi
}
_zrake
()
{
local
expl
declare
-
a
tasks
if
[
-
f
Rakefile
];
then
if
_rake_does_task_list_need_generating
;
then
echo
"
\n
Generating .rake_tasks..."
>
/
dev
/
stderr
rake
--
silent
--
tasks
|
cut
-
d
" "
-
f
2
>
.
rake_tasks
fi
tasks
=(`
cat
.
rake_tasks
`)
_wanted
tasks
expl
'rake'
compadd
$
tasks
fi
}
local
expl
local
expl
local -a pkgs installed_pkgs
local
curcontext
=
"$curcontext"
state
line
typeset
-
A
opt_args
_arguments \
_arguments
-
C
\
'*:: :->subcmds' && return 0
':command:->command'
\
'*::options:->options'
if (( CURRENT == 1 )); then
_describe -t commands "zeus subcommand" _1st_arguments
return
fi
_files
case
$
state
in
(
command
)
_describe
-
t
commands
"zeus subcommand"
_1st_arguments
return
;;
(
options
)
case
$
line
[
1
]
in
(
rake
)
_zrake
;;
(
generate
|
g
|
destroy
|
d
)
_rails_generate_arguments
_wanted
generate_arguments
expl
'all generate'
compadd
-
a
generate_arguments
;;
esac
;;
esac
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment