fda5afaebca57250792696e29c2e111f41f6fce4
- Author
- yleo77 <ylep77@gmail.com>
- Committer
- yleo77 <ylep77@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/capistrano/_capistrano b/plugins/capistrano/_capistrano
2index 1002dad96fbb4c42803729153642933a344892a0..3cadf3d54be8aabaacaf509d5ca75ab14eb97910 100644
3--- a/plugins/capistrano/_capistrano
4+++ b/plugins/capistrano/_capistrano
5@@ -4,7 +4,7 @@
6 if [[ -f config/deploy.rb || -f Capfile ]]; then
7 if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
8 echo "\nGenerating .cap_tasks~..." > /dev/stderr
9- cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
10+ cap -v --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
11 fi
12 compadd `cat .cap_tasks~`
13 fi
14diff --git a/plugins/docker/README.md b/plugins/docker/README.md
15new file mode 100644
16index 0000000000000000000000000000000000000000..231a6dcf5d1fc656e02ed0fcc98e606fd8109ce6
17--- /dev/null
18+++ b/plugins/docker/README.md
19@@ -0,0 +1,19 @@
20+## Docker autocomplete plugin
21+
22+- Adds autocomplete options for all docker commands.
23+- Will also show containerIDs and Image names where applicable
24+
25+####Shows help for all commands
26+
27+
28+
29+####Shows your downloaded images where applicable
30+
31+
32+
33+####Shows your running containers where applicable
34+
35+
36+
37+
38+Maintainer : Ahmed Azaan ([@aeonazaan](https://twitter.com/aeonazaan))
39diff --git a/plugins/docker/_docker b/plugins/docker/_docker
40new file mode 100644
41index 0000000000000000000000000000000000000000..f13f876cf9c97af4ed7d8598fba3325f60ac6cca
42--- /dev/null
43+++ b/plugins/docker/_docker
44@@ -0,0 +1,290 @@
45+#compdef docker
46+
47+# Docker autocompletion for oh-my-zsh
48+# Requires: Docker installed
49+# Author : Azaan (@aeonazaan)
50+
51+
52+# ----- Helper functions
53+# Output a selectable list of all running docker containers
54+__docker_containers() {
55+ declare -a cont_cmd
56+ cont_cmd=($(docker ps | awk 'NR>1{print $1":[CON("$1")"$2"("$3")]"}'))
57+ _describe 'containers' cont_cmd
58+}
59+
60+# output a selectable list of all docker images
61+__docker_images() {
62+ declare -a img_cmd
63+ img_cmd=($(docker images | awk 'NR>1{print $1}'))
64+ _describe 'images' img_cmd
65+}
66+
67+# ----- Commands
68+# Seperate function for each command, makes extension easier later
69+# ---------------------------
70+__attach() {
71+ __docker_containers
72+}
73+
74+__build() {
75+ _arguments \
76+ '-q=false[Suppress verbose build output]' \
77+ '-t="[fuck to be applied to the resulting image in case of success]' \
78+ '*:files:_files'
79+}
80+
81+__commit() {
82+ _arguments \
83+ '-author="[Author]' \
84+ '-m="[Commit message]' \
85+ '-run="[Config automatically applied when the image is run.\n]'
86+ __docker_containers
87+}
88+
89+__diff() {
90+ __docker_containers
91+}
92+
93+__export() {
94+ __docker_containers
95+}
96+
97+
98+__history() {
99+ __docker_images
100+}
101+
102+__images() {
103+ _arguments \
104+ '-a[show all images]' \
105+ '-notrunc[dont truncate output]' \
106+ '-q[only show numeric IDs]' \
107+ '-viz[output graph in graphviz format]'
108+ __docker_images
109+}
110+
111+__import() {
112+ _arguments '*:files:_files'
113+}
114+
115+__info() {
116+ # no arguments
117+}
118+
119+__insert() {
120+ __docker_images
121+ _arguments '*:files:_files'
122+}
123+
124+__inspect() {
125+ __docker_images
126+ __docker_containers
127+}
128+
129+__kill() {
130+ __docker_containers
131+}
132+
133+__login() {
134+ _arguments \
135+ '-e="[email]' \
136+ '-p="[password]' \
137+ '-u="[username]' \
138+}
139+
140+__logs() {
141+ __docker_containers
142+}
143+
144diff --git a/plugins/gem/_gem b/plugins/gem/_gem
145index 83cba40d135796280447ee6a1daf6c9e73df53de..975cec602ee800f92b9fbe6afc15a9e98bdd0f9d 100644
146--- a/plugins/gem/_gem
147+++ b/plugins/gem/_gem
148@@ -9,8 +9,9 @@ _gem_installed() {
149
150 local -a _1st_arguments
151 _1st_arguments=(
152+ 'build:Build a gem from a gemspec'
153 'cert:Manage RubyGems certificates and signing settings'
154- 'check:Check installed gems'
155+ 'check:Check a gem repository for added or missing files'
156 'cleanup:Clean up old versions of installed gems in the local repository'
157 'contents:Display the contents of the installed gems'
158 'dependency:Show the dependencies of an installed gem'
159@@ -21,7 +22,7 @@ _1st_arguments=(
160 'install:Install a gem into the local repository'
161 'list:Display gems whose name starts with STRING'
162 'lock:Generate a lockdown list of gems'
163- 'mirror:Mirror a gem repository'
164+ 'mirror:Mirror all gem files (requires rubygems-mirror)'
165 'outdated:Display all gems that need updates'
166 'owner:Manage gem owners on RubyGems.org.'
167 'pristine:Restores installed gems to pristine condition from files located in the gem cache'
168@@ -35,8 +36,9 @@ _1st_arguments=(
169 'stale:List gems along with access times'
170 'uninstall:Uninstall gems from the local repository'
171 'unpack:Unpack an installed gem to the current directory'
172- 'update:Update the named gems (or all installed gems) in the local repository'
173+ 'update:Update installed gems to the latest version'
174 'which:Find the location of a library file you can require'
175+ 'yank:Remove a specific gem version release from RubyGems.org'
176 )
177
178 local expl
179diff --git a/plugins/git/_git-branch b/plugins/git/_git-branch
180index 86d03bc30eeb1a7c0349b20bfcf83f46b95f6d8c..6b9c1a483e92c5c5219a69c6f25f319009db02fd 100644
181--- a/plugins/git/_git-branch
182+++ b/plugins/git/_git-branch
183@@ -60,3 +60,24 @@ _git-branch ()
184 "($l $c $m -d)-D[delete a branch]" \
185 $dependent_deletion_args
186 }
187+
188+(( $+functions[__git_ignore_line] )) ||
189+__git_ignore_line () {
190+ declare -a ignored
191+ ignored=()
192+ ((CURRENT > 1)) &&
193+ ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
194+ ((CURRENT < $#line)) &&
195+ ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
196+ $* -F ignored
197+}
198+
199+(( $+functions[__git_ignore_line_inside_arguments] )) ||
200+__git_ignore_line_inside_arguments () {
201+ declare -a compadd_opts
202+
203+ zparseopts -D -E -a compadd_opts V: J: 1 2 n f X: M: P: S: r: R: q F:
204+
205+ __git_ignore_line $* $compadd_opts
206+}
207+
208diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
209index 9087a14ead77a15799d9b70543a1502ea825518c..aad7761897f24a271707535f749bcff388c8bdf2 100644
210--- a/plugins/git/git.plugin.zsh
211+++ b/plugins/git/git.plugin.zsh
212@@ -22,6 +22,8 @@ alias gca='git commit -v -a'
213 compdef _git gc=git-commit
214 alias gca!='git commit -v -a --amend'
215 compdef _git gca!=git-commit
216+alias gcmsg='git commit -m'
217+compdef _git gcmsg=git-commit
218 alias gco='git checkout'
219 compdef _git gco=git-checkout
220 alias gcm='git checkout master'
221diff --git a/plugins/knife_ssh/knife_ssh.plugin.zsh b/plugins/knife_ssh/knife_ssh.plugin.zsh
222new file mode 100644
223index 0000000000000000000000000000000000000000..7fdd42a1ebb30d2a403aef42081ddae2b6db205d
224--- /dev/null
225+++ b/plugins/knife_ssh/knife_ssh.plugin.zsh
226@@ -0,0 +1,18 @@
227+function knife_ssh() {
228+ grep -q $1 ~/.knife_comp~ 2> /dev/null || rm -f ~/.knife_comp~;
229+ ssh $(knife node show $1 | awk '/IP:/{print $2}')
230+}
231+
232+_knife_ssh() {
233+ if hash knife 2>/dev/null; then
234+ if [[ ! -f ~/.knife_comp~ ]]; then
235+ echo "\nGenerating ~/.knife_comp~..." >/dev/stderr
236+ knife node list > ~/.knife_comp~
237+ fi
238+ compadd $(<~/.knife_comp~)
239+ else
240+ echo "Could not find knife" > /dev/stderr;
241+ fi
242+}
243+
244+compdef _knife_ssh knife_ssh
245diff --git a/plugins/mix/_mix b/plugins/mix/_mix
246new file mode 100644
247index 0000000000000000000000000000000000000000..602f5ffa0a94a351c7a2a65d2a6720df59e6b1e7
248--- /dev/null
249+++ b/plugins/mix/_mix
250@@ -0,0 +1,63 @@
251+#compdef mix
252+#autoload
253+
254+# Elixir mix zsh completion
255+
256+local -a _1st_arguments
257+_1st_arguments=(
258+ 'archive:Archive this project into a .ez file'
259+ 'clean:Clean generated application files'
260+ 'compile:Compile source files'
261+ 'deps:List dependencies and their status'
262+ "deps.clean:Remove dependencies' files"
263+ 'deps.compile:Compile dependencies'
264+ 'deps.get:Get all out of date dependencies'
265+ 'deps.unlock:Unlock the given dependencies'
266+ 'deps.update:Update dependencies'
267+ 'do:Executes the commands separated by comma'
268+ 'escriptize:Generates an escript for the project'
269+ 'help:Print help information for tasks'
270+ 'local:List local tasks'
271+ 'local.install:Install a task or an archive locally'
272+ 'local.rebar:Install rebar locally'
273+ 'local.uninstall:Uninstall local tasks or archives'
274+ 'new:Creates a new Elixir project'
275+ 'run:Run the given file or expression'
276+ "test:Run a project's tests"
277+ '--help:Describe available tasks'
278+ '--version:Prints the Elixir version information'
279+)
280+
281+__task_list ()
282+{
283+ local expl
284+ declare -a tasks
285+
286+ tasks=(archive clean compile deps deps.clean deps.compile deps.get deps.unlock deps.update do escriptize help local local.install local.rebar local.uninstall new run test)
287+
288+ _wanted tasks expl 'help' compadd $tasks
289+}
290+
291+local expl
292+
293+local curcontext="$curcontext" state line
294+typeset -A opt_args
295+
296+_arguments -C \
297+ ':command:->command' \
298+ '*::options:->options'
299+
300+case $state in
301+ (command)
302+ _describe -t commands "mix subcommand" _1st_arguments
303+ return
304+ ;;
305+
306+ (options)
307+ case $line[1] in
308+ (help)
309+ _arguments ':feature:__task_list'
310+ esac
311+ ;;
312+esac
313+
314diff --git a/plugins/pod/_pod b/plugins/pod/_pod
315new file mode 100644
316index 0000000000000000000000000000000000000000..563fa5e666459bee4c92bb588cbc8681be404c07
317--- /dev/null
318+++ b/plugins/pod/_pod
319@@ -0,0 +1,381 @@
320+#compdef pod
321+#autoload
322+
323+# -----------------------------------------------------------------------------
324+# FILE: _pod
325+# DESCRIPTION: Cocoapods autocomplete plugin for Oh-My-Zsh
326+# http://cocoapods.org
327+# AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch)
328+# GITHUB: https://github.com/mekanics
329+# TWITTER: @jolyAlexandre
330+# VERSION: 0.0.1
331+# LICENSE: MIT
332+# -----------------------------------------------------------------------------
333+
334+local -a _1st_arguments
335+_1st_arguments=(
336+ 'help:Show help for the given command.'
337+ 'install:Install project dependencies'
338+ 'ipc:Inter-process communication'
339+ 'list:List pods'
340+ 'outdated:Show outdated project dependencies'
341+ 'podfile-info:Shows information on installed Pods'
342+ 'push:Push new specifications to a spec-repo'
343+ 'repo:Manage spec-repositories'
344+ 'search:Searches for pods'
345+ 'setup:Setup the CocoaPods environment'
346+ 'spec:Manage pod specs'
347+ 'update:Update outdated project dependencies'
348+)
349+
350+local -a _repo_arguments
351+_repo_arguments=(
352+ 'add:Add a spec repo'
353+ 'lint:Validates all specs in a repo'
354+ 'update:Update a spec repo'
355+)
356+
357+local -a _spec_arguments
358+_spec_arguments=(
359+ 'cat:Prints a spec file'
360+ 'create:Create spec file stub'
361+ 'edit:Edit a spec file'
362+ 'lint:Validates a spec file'
363+ 'which:Prints the path of the given spec'
364+)
365+
366+local -a _ipc_arguments
367+_ipc_arguments=(
368+ 'list:Lists the specifications know to CocoaPods'
369+ 'podfile:Converts a Podfile to YAML'
370+ 'repl:The repl listens to commands on standard input'
371+ 'spec:Converts a podspec to YAML'
372+ 'update-search-index:Updates the search index'
373+)
374+
375+local -a _list_arguments
376+_list_arguments=(
377+ 'new:Lists pods introduced in the master spec-repo since the last check'
378+)
379+
380+local -a _inherited_options
381+_inherited_options=(
382+ '(--silent)--silent[Show nothing]' \
383+ '(--version)--version[Show the version of CocoaPods]' \
384+ '(--no-color)--no-color[Show output without color]' \
385+ '(--verbose)--verbose[Show more debugging information]' \
386+ '(--help)--help[Show help banner of specified command]'
387+)
388+
389+local -a _install_options
390+_install_options=(
391+ '(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn` intact after downloading]' \
392+ '(--no-integrate)--no-integrate[Skip integration of the Pods libraries in the Xcode project(s)]' \
393+ '(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]'
394+)
395+
396+local -a _update_options
397+_update_options=(
398+ '(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn intact after downloading]' \
399+ '(--no-integrate)--no-integrate[Skip integration of the Pods libraries in the Xcode project(s)]' \
400+ '(--no-repo-update)--no-repo-update[Skip running `pod repo update before install]'
401+)
402+
403+local -a _outdated_options
404+_outdated_options=(
405+ '(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]'
406+)
407+
408+local -a _search_options
409+_search_options=(
410+ '(--full)--full[Search by name, summary, and description]' \
411+ '(--stats)--stats[Show additional stats (like GitHub watchers and forks)]' \
412+ '(--ios)--ios[Restricts the search to Pods supported on iOS]' \
413+ '(--osx)--osx[Restricts the search to Pods supported on OS X]'
414+)
415+
416+local -a _list_options
417+_list_options=(
418+ '(--update)--update[Run `pod repo update` before listing]'
419diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
420index 2555fab67218005c4d84bfed089451e7020e34c9..b53d18d08f45a07538d45a7e7a841b643bc859f5 100644
421--- a/plugins/rails3/rails3.plugin.zsh
422+++ b/plugins/rails3/rails3.plugin.zsh
423@@ -4,7 +4,11 @@ function _rails_command () {
424 if [ -e "script/server" ]; then
425 ruby script/$@
426 else
427- ruby script/rails $@
428+ if [ -e "bin/rails" ]; then
429+ bin/rails $@
430+ else
431+ rails $@
432+ fi
433 fi
434 }
435
436diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
437index 7468749f8b9c2d1395d4d4c0a7a51e09d2b74c7e..3b0042a7d6077c24ead0ac4aa4e11a5fe25d7918 100644
438--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
439+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
440@@ -9,7 +9,7 @@
441 # To load multiple identities use the identities style, For
442 # example:
443 #
444-# zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github
445+# zstyle :omz:plugins:ssh-agent identities id_rsa id_rsa2 id_github
446 #
447 # To set the maximum lifetime of the identities, use the
448 # lifetime style. The lifetime may be specified in seconds
449diff --git a/plugins/symfony/symfony.plugin.zsh b/plugins/symfony/symfony.plugin.zsh
450index 9de767548b85e282ab994ca0d3522587f1fcba49..f070e9e47f40d12757445c0f4e555f82f4148877 100644
451--- a/plugins/symfony/symfony.plugin.zsh
452+++ b/plugins/symfony/symfony.plugin.zsh
453@@ -1,7 +1,7 @@
454 # symfony basic command completion
455
456 _symfony_get_command_list () {
457- ./symfony | sed "1,/Available tasks/d" | awk 'BEGIN { cat=null; } /^[A-Za-z]+$/ { cat = $1; } /^ :[a-z]+/ { print cat $1; }'
458+ php symfony | sed "1,/Available tasks/d" | awk 'BEGIN { cat=null; } /^[A-Za-z]+$/ { cat = $1; } /^ :[a-z]+/ { print cat $1; }'
459 }
460
461 _symfony () {