summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2019-10-21 16:01:02 -0600
committerTuowen Zhao <ztuowen@gmail.com>2019-10-21 16:01:02 -0600
commit2e9fe98b8a9fe21b982e719e129678dede63771e (patch)
treee1dd9634ace0de1c752bddcbc67a998b7d73d40b /plugins
parent112a85697481cae663ff281b74fdc1f72a67b294 (diff)
parent534ec60bfd14ee640076c7594ee4fa723fafd1b1 (diff)
downloadzsh-2e9fe98b8a9fe21b982e719e129678dede63771e.tar.gz
zsh-2e9fe98b8a9fe21b982e719e129678dede63771e.tar.bz2
zsh-2e9fe98b8a9fe21b982e719e129678dede63771e.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins')
-rw-r--r--plugins/bundler/bundler.plugin.zsh4
-rw-r--r--plugins/cargo/_cargo853
-rw-r--r--plugins/docker/README.md14
-rw-r--r--plugins/eecms/README.md11
-rw-r--r--plugins/fzf/fzf.plugin.zsh12
-rw-r--r--plugins/git-remote-branch/README.md14
-rw-r--r--plugins/magic-enter/Readme.md17
-rw-r--r--plugins/pass/README.md22
-rw-r--r--plugins/phing/README.md8
-rw-r--r--plugins/pod/README.md10
-rw-r--r--plugins/rails/rails.plugin.zsh2
-rw-r--r--plugins/rake/README.md37
-rw-r--r--plugins/rbenv/README.md26
-rw-r--r--plugins/rust/README.md9
-rw-r--r--plugins/safe-paste/README.md9
-rw-r--r--plugins/screen/README.md10
-rw-r--r--plugins/supervisor/README.md12
-rw-r--r--plugins/supervisor/_supervisorctl7
18 files changed, 562 insertions, 515 deletions
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index c4a4fd40a..665cb5e43 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -82,7 +82,7 @@ _bundler-installed() {
_within-bundled-project() {
local check_dir="$PWD"
while [ "$check_dir" != "/" ]; do
- [ -f "$check_dir/Gemfile" ] && return
+ [ -f "$check_dir/Gemfile" -o -f "$check_dir/gems.rb" ] && return
check_dir="$(dirname $check_dir)"
done
false
@@ -95,7 +95,7 @@ _binstubbed() {
_run-with-bundler() {
if _bundler-installed && _within-bundled-project; then
if _binstubbed $1; then
- ./bin/$@
+ ./bin/${^^@}
else
bundle exec $@
fi
diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo
index 395c517cd..12694901e 100644
--- a/plugins/cargo/_cargo
+++ b/plugins/cargo/_cargo
@@ -2,489 +2,367 @@
autoload -U regexp-replace
-zstyle -T ':completion:*:*:cargo:*' tag-order && \
- zstyle ':completion:*:*:cargo:*' tag-order 'common-commands'
-
_cargo() {
-local context state state_descr line
-typeset -A opt_args
-
-# leading items in parentheses are an exclusion list for the arguments following that arg
-# See: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions
-# - => exclude all other options
-# 1 => exclude positional arg 1
-# * => exclude all other args
-# +blah => exclude +blah
-_arguments \
- '(- 1 *)'{-h,--help}'[show help message]' \
- '(- 1 *)--list[list installed commands]' \
- '(- 1 *)'{-V,--version}'[show version information]' \
- {-v,--verbose}'[use verbose output]' \
- --color'[colorization option]' \
- '(+beta +nightly)+stable[use the stable toolchain]' \
- '(+stable +nightly)+beta[use the beta toolchain]' \
- '(+stable +beta)+nightly[use the nightly toolchain]' \
- '1: :->command' \
- '*:: :->args'
-
-case $state in
- command)
- _alternative 'common-commands:common:_cargo_cmds' 'all-commands:all:_cargo_all_cmds'
- ;;
-
- args)
- case $words[1] in
- bench)
- _arguments \
- '--features=[space separated feature list]' \
- '--all-features[enable all available features]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
- "${command_scope_spec[@]}" \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--no-default-features[do not build the default features]' \
- '--no-run[compile but do not run]' \
- '(-p,--package)'{-p=,--package=}'[package to run benchmarks for]:packages:_get_package_names' \
- '--target=[target triple]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- build)
- _arguments \
- '--features=[space separated feature list]' \
- '--all-features[enable all available features]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
- "${command_scope_spec[@]}" \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--no-default-features[do not build the default features]' \
- '(-p,--package)'{-p=,--package=}'[package to build]:packages:_get_package_names' \
- '--release=[build in release mode]' \
- '--target=[target triple]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- check)
- _arguments \
- '--features=[space separated feature list]' \
- '--all-features[enable all available features]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
- "${command_scope_spec[@]}" \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--no-default-features[do not check the default features]' \
- '(-p,--package)'{-p=,--package=}'[package to check]:packages:_get_package_names' \
- '--release=[check in release mode]' \
- '--target=[target triple]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- clean)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '(-p,--package)'{-p=,--package=}'[package to clean]:packages:_get_package_names' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--release[whether or not to clean release artifacts]' \
- '--target=[target triple(default:all)]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- doc)
- _arguments \
- '--features=[space separated feature list]' \
- '--all-features[enable all available features]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--no-deps[do not build docs for dependencies]' \
- '--no-default-features[do not build the default features]' \
- '--open[open docs in browser after the build]' \
- '(-p, --package)'{-p,--package}'=[package to document]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--release[build artifacts in release mode, with optimizations]' \
- '--target=[build for the target triple]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- fetch)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- generate-lockfile)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- git-checkout)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--reference=[REF]' \
- '--url=[URL]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- help)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '*: :_cargo_cmds' \
- ;;
-
- init)
- _arguments \
- '--bin[use binary template]' \
- '--vcs:initialize a new repo with a given VCS:(git hg none)' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--name=[set the resulting package name]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- install)
- _arguments \
- '--bin=[only install the specified binary]' \
- '--branch=[branch to use when installing from git]' \
- '--color=:colorization option:(auto always never)' \
- '--debug[build in debug mode instead of release mode]' \
- '--example[install the specified example instead of binaries]' \
- '--features=[space separated feature list]' \
- '--all-features[enable all available features]' \
- '--git=[URL from which to install the crate]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
- '--no-default-features[do not build the default features]' \
- '--path=[local filesystem path to crate to install]: :_files -/' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--rev=[specific commit to use when installing from git]' \
- '--root=[directory to install packages into]: :_files -/' \
- '--tag=[tag to use when installing from git]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--vers=[version to install from crates.io]' \
- ;;
-
- locate-project)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- ;;
-
- login)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--host=[Host to set the token for]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- metadata)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- "--no-deps[output information only about the root package and don't fetch dependencies]" \
- '--no-default-features[do not include the default feature]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--features=[space separated feature list]' \
- '--all-features[enable all available features]' \
- '--format-version=[format version(default: 1)]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- new)
- _arguments \
- '--bin[use binary template]' \
- '--vcs:initialize a new repo with a given VCS:(git hg none)' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--name=[set the resulting package name]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- owner)
- _arguments \
- '(-a, --add)'{-a,--add}'[add owner LOGIN]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--index[registry index]' \
- '(-l, --list)'{-l,--list}'[list owners of a crate]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-r, --remove)'{-r,--remove}'[remove owner LOGIN]' \
- '--token[API token to use when authenticating]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- package)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-l, --list)'{-l,--list}'[print files included in a package without making one]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--no-metadata[ignore warnings about a lack of human-usable metadata]' \
- '--no-verify[do not build to verify contents]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- pkgid)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- publish)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--host=[Host to set the token for]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--no-verify[Do not verify tarball until before publish]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--token[token to use when uploading]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- read-manifest)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- run)
- _arguments \
- '--example=[name of the bin target]' \
- '--features=[space separated feature list]' \
- '--all-features[enable all available features]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--bin=[name of the bin target]' \
- '--no-default-features[do not build the default features]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--release=[build in release mode]' \
- '--target=[target triple]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- '*: :_normal' \
- ;;
-
- rustc)
- _arguments \
- '--color=:colorization option:(auto always never)' \
- '--features=[features to compile for the package]' \
- '--all-features[enable all available features]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \
- '--manifest-path=[path to the manifest to fetch dependencies for]: :_files -/' \
- '--no-default-features[do not compile default features for the package]' \
- '(-p, --package)'{-p,--package}'=[profile to compile for]' \
- '--profile=[profile to build the selected target for]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--release[build artifacts in release mode, with optimizations]' \
- '--target=[target triple which compiles will be for]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- "${command_scope_spec[@]}" \
- ;;
-
- rustdoc)
- _arguments \
- '--color=:colorization option:(auto always never)' \
- '--features=[space-separated list of features to also build]' \
- '--all-features[enable all available features]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \
- '--manifest-path=[path to the manifest to document]: :_files -/' \
- '--no-default-features[do not build the `default` feature]' \
- '--open[open the docs in a browser after the operation]' \
- '(-p, --package)'{-p,--package}'=[package to document]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--release[build artifacts in release mode, with optimizations]' \
- '--target=[build for the target triple]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- "${command_scope_spec[@]}" \
- ;;
-
- search)
- _arguments \
- '--color=:colorization option:(auto always never)' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--host=[host of a registry to search in]' \
- '--limit=[limit the number of results]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- ;;
-
- test)
- _arguments \
- '--features=[space separated feature list]' \
- '--all-features[enable all available features]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '--test=[test name]: :_test_names' \
- '--no-default-features[do not build the default features]' \
- '--no-fail-fast[run all tests regardless of failure]' \
- '--no-run[compile but do not run]' \
- '(-p,--package)'{-p=,--package=}'[package to run tests for]:packages:_get_package_names' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--release[build artifacts in release mode, with optimizations]' \
- '--target=[target triple]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- '1: :_test_names' \
- '(--doc --bin --example --test --bench)--lib[only test library]' \
- '(--lib --bin --example --test --bench)--doc[only test documentation]' \
- '(--lib --doc --example --test --bench)--bin=[binary name]' \
- '(--lib --doc --bin --test --bench)--example=[example name]' \
- '(--lib --doc --bin --example --bench)--test=[test name]' \
- '(--lib --doc --bin --example --test)--bench=[benchmark name]' \
- '--message-format:error format:(human json short)' \
- '--frozen[require lock and cache up to date]' \
- '--locked[require lock up to date]'
- ;;
-
- uninstall)
- _arguments \
- '--bin=[only uninstall the binary NAME]' \
- '--color=:colorization option:(auto always never)' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-q, --quiet)'{-q,--quiet}'[less output printed to stdout]' \
- '--root=[directory to uninstall packages from]: :_files -/' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- ;;
-
- update)
- _arguments \
- '--aggressive=[force dependency update]' \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '(-p,--package)'{-p=,--package=}'[package to update]:packages:__get_package_names' \
- '--precise=[update single dependency to PRECISE]: :' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- verify-project)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--manifest-path=[path to manifest]: :_files -/' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- version)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- ;;
-
- yank)
- _arguments \
- '(-h, --help)'{-h,--help}'[show help message]' \
- '--index[registry index]' \
- '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
- '--token[API token to use when authenticating]' \
- '--undo[undo a yank, putting a version back into the index]' \
- '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
- '--color=:colorization option:(auto always never)' \
- '--vers[yank version]' \
- ;;
- esac
- ;;
-esac
+ local curcontext="$curcontext" ret=1
+ local -a command_scope_spec common parallel features msgfmt triple target registry
+ local -a state line state_descr # These are set by _arguments
+ typeset -A opt_args
+
+ common=(
+ '(-q --quiet)*'{-v,--verbose}'[use verbose output]'
+ '(-q --quiet -v --verbose)'{-q,--quiet}'[no output printed to stdout]'
+ '-Z+[pass unstable (nightly-only) flags to cargo]: :_cargo_unstable_flags'
+ '--frozen[require that Cargo.lock and cache are up-to-date]'
+ '--locked[require that Cargo.lock is up-to-date]'
+ '--color=[specify colorization option]:coloring:(auto always never)'
+ '(- 1 *)'{-h,--help}'[show help message]'
+ )
+
+ # leading items in parentheses are an exclusion list for the arguments following that arg
+ # See: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions
+ # - => exclude all other options
+ # 1 => exclude positional arg 1
+ # * => exclude all other args
+ # +blah => exclude +blah
+ _arguments -s -S -C $common \
+ '(- 1 *)--list[list installed commands]' \
+ '(- 1 *)--explain=[provide a detailed explanation of an error message]:error code' \
+ '(- 1 *)'{-V,--version}'[show version information]' \
+ '(+beta +nightly)+stable[use the stable toolchain]' \
+ '(+stable +nightly)+beta[use the beta toolchain]' \
+ '(+stable +beta)+nightly[use the nightly toolchain]' \
+ '1: :_cargo_cmds' \
+ '*:: :->args'
+
+ # These flags are mutually exclusive specifiers for the scope of a command; as
+ # they are used in multiple places without change, they are expanded into the
+ # appropriate command's `_arguments` where appropriate.
+ command_scope_spec=(
+ '(--bin --example --test --lib)--bench=[specify benchmark name]: :_cargo_benchmark_names'
+ '(--bench --bin --test --lib)--example=[specify example name]:example name'
+ '(--bench --example --test --lib)--bin=[specify binary name]:binary name'
+ '(--bench --bin --example --test)--lib=[specify library name]:library name'
+ '(--bench --bin --example --lib)--test=[specify test name]:test name'
+ )
+
+ parallel=(
+ '(-j --jobs)'{-j+,--jobs=}'[specify number of parallel jobs]:jobs [# of CPUs]'
+ )
+
+ features=(
+ '(--all-features)--features=[specify features to activate]:feature'
+ '(--features)--all-features[activate all available features]'
+ "--no-default-features[don't build the default features]"
+ )
+
+ msgfmt='--message-format=[specify error format]:error format [human]:(human json short)'
+ triple='--target=[specify target triple]:target triple'
+ target='--target-dir=[specify directory for all generated artifacts]:directory:_directories'
+ manifest='--manifest-path=[specify path to manifest]:path:_directories'
+ registry='--registry=[specify registry to use]:registry'
+
+ case $state in
+ args)
+ curcontext="${curcontext%:*}-${words[1]}:"
+ case ${words[1]} in
+ bench)
+ _arguments -s -A "^--" $common $parallel $features $msgfmt $triple $target $manifest \
+ "${command_scope_spec[@]}" \
+ '--all-targets[benchmark all targets]' \
+ "--no-run[compile but don't run]" \
+ '(-p --package)'{-p+,--package=}'[specify package to run benchmarks for]:package:_cargo_package_names' \
+ '--exclude=[exclude packages from the benchmark]:spec' \
+ '--no-fail-fast[run all benchmarks regardless of failure]' \
+ '1: :_guard "^-*" "bench name"' \
+ '*:args:_default'
+ ;;
+
+ build)
+ _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
+ '--all-targets[equivalent to specifying --lib --bins --tests --benches --examples]' \
+ "${command_scope_spec[@]}" \
+ '(-p --package)'{-p+,--package=}'[specify package to build]:package:_cargo_package_names' \
+ '--release[build in release mode]' \
+ '--build-plan[output the build plan in JSON]' \
+ ;;
+
+ check)
+ _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
+ '--all-targets[equivalent to specifying --lib --bins --tests --benches --examples]' \
+ "${command_scope_spec[@]}" \
+ '(-p --package)'{-p+,--package=}'[specify package to check]:package:_cargo_package_names' \
+ '--release[check in release mode]' \
+ ;;
+
+ clean)
+ _arguments -s -S $common $triple $target $manifest \
+ '(-p --package)'{-p+,--package=}'[specify package to clean]:package:_cargo_package_names' \
+ '--release[clean release artifacts]' \
+ '--doc[clean just the documentation directory]'
+ ;;
+
+ doc)
+ _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
+ '--no-deps[do not build docs for dependencies]' \
+ '--document-private-items[include non-public items in the documentation]' \
+ '--open[open docs in browser after the build]' \
+ '(-p --package)'{-p+,--package=}'[specify package to document]:package:_cargo_package_names' \
+ '--release[build artifacts in release mode, with optimizations]' \
+ ;;
+
+ fetch)
+ _arguments -s -S $common $triple $manifest
+ ;;
+
+ fix)
+ _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
+ "${command_scope_spec[@]}" \
+ '--broken-code[fix code even if it already has compiler errors]' \
+ '--edition[fix in preparation for the next edition]' \
+ '--edition-idioms[fix warnings to migrate to the idioms of an edition]' \
+ '--allow-no-vcs[fix code even if a VCS was not detected]' \
+ '--allow-dirty[fix code even if the working directory is dirty]' \
+ '--allow-staged[fix code even if the working directory has staged changes]'
+ ;;
+
+ generate-lockfile)
+ _arguments -s -S $common $manifest
+ ;;
+
+ git-checkout)
+ _arguments -s -S $common \
+ '--reference=:reference' \
+ '--url=:url:_urls'
+ ;;
+
+ help)
+ _cargo_cmds
+ ;;
+
+ init)
+ _arguments -s -S $common $registry \
+ '--lib[use library template]' \
+ '--edition=[specify edition to set for the crate generated]:edition:(2015 2018)' \
+ '--vcs=[initialize a new repo with a given VCS]:vcs:(git hg pijul fossil none)' \
+ '--name=[set the resulting package name]:name' \
+ '1:path:_directories'
+ ;;
+
+ install)
+ _arguments -s -S $common $parallel $features $triple $registry \
+ '(-f --force)'{-f,--force}'[force overwriting of existing crates or binaries]' \
+ '--bin=[only install the specified binary]:binary' \
+ '--branch=[branch to use when installing from git]:branch' \
+ '--debug[build in debug mode instead of release mode]' \
+ '--example=[install the specified example instead of binaries]:example' \
+ '--git=[specify URL from which to install the crate]:url:_urls' \
+ '--path=[local filesystem path to crate to install]: :_directories' \
+ '--rev=[specific commit to use when installing from git]:commit' \
+ '--root=[directory to install packages into]: :_directories' \
+ '--tag=[tag to use when installing from git]:tag' \
+ '--vers=[version to install from crates.io]:version' \
+ '--list[list all installed packages and their versions]' \
+ '*: :_guard "^-*" "crate"'
+ ;;
+
+ locate-project)
+ _arguments -s -S $common $manifest
+ ;;
+
+ login)
+ _arguments -s -S $common $registry \
+ '*: :_guard "^-*" "token"'
+ ;;
+
+ metadata)
+ _arguments -s -S $common $features $manifest \
+ "--no-deps[output information only about the root package and don't fetch dependencies]" \
+ '--format-version=[specify format version]:version [1]:(1)'
+ ;;
+
+ new)
+ _arguments -s -S $common $registry \
+ '--lib[use library template]' \
+ '--vcs:initialize a new repo with a given VCS:(git hg none)' \
+ '--name=[set the resulting package name]'
+ ;;
+
+ owner)
+ _arguments -s -S $common $registry \
+ '(-a --add)'{-a,--add}'[specify name of a user or team to invite as an owner]:name' \
+ '--index=[specify registry index]:index' \
+ '(-l --list)'{-l,--list}'[list owners of a crate]' \
+ '(-r --remove)'{-r,--remove}'[specify name of a user or team to remove as an owner]:name' \
+ '--token=[specify API token to use when authenticating]:token' \
+ '*: :_guard "^-*" "crate"'
+ ;;
+
+ package)
+ _arguments -s -S $common $parallel $features $triple $target $manifest \
+ '(-l --list)'{-l,--list}'[print files included in a package without making one]' \
+ '--no-metadata[ignore warnings about a lack of human-usable metadata]' \
+ '--allow-dirty[allow dirty working directories to be packaged]' \
+ "--no-verify[don't build to verify contents]"
+ ;;
+
+ pkgid)
+ _arguments -s -S $common $manifest \
+ '(-p --package)'{-p+,--package=}'[specify package to get ID specifier for]:package:_cargo_package_names' \
+ '*: :_guard "^-*" "spec"'
+ ;;
+
+ publish)
+ _arguments -s -S $common $parallel $features $triple $target $manifest $registry \
+ '--index=[specify registry index]:index' \
+ '--allow-dirty[allow dirty working directories to be packaged]' \
+ "--no-verify[don't verify the contents by building them]" \
+ '--token=[specify token to use when uploading]:token' \
+ '--dry-run[perform all checks without uploading]'
+ ;;
+
+ read-manifest)
+ _arguments -s -S $common $manifest
+ ;;
+
+ run)
+ _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
+ '--example=[name of the bin target]:name' \
+ '--bin=[name of the bin target]:name' \
+ '(-p --package)'{-p+,--package=}'[specify package with the target to run]:package:_cargo_package_names' \
+ '--release[build in release mode]' \
+ '*: :_default'
+ ;;
+
+ rustc)
+ _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
+ '(-p --package)'{-p+,--package=}'[specify package to build]:package:_cargo_package_names' \
+ '--profile=[specify profile to build the selected target for]:profile' \
+ '--release[build artifacts in release mode, with optimizations]' \
+ "${command_scope_spec[@]}" \
+ '*: : _dispatch rustc rustc -default-'
+ ;;
+
+ rustdoc)
+ _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
+ '--document-private-items[include non-public items in the documentation]' \
+ '--open[open the docs in a browser after the operation]' \
+ '(-p --package)'{-p+,--package=}'[specify package to document]:package:_cargo_package_names' \
+ '--release[build artifacts in release mode, with optimizations]' \
+ "${command_scope_spec[@]}" \
+ '*: : _dispatch rustdoc rustdoc -default-'
+ ;;
+
+ search)
+ _arguments -s -S $common $registry \
+ '--index=[specify registry index]:index' \
+ '--limit=[limit the number of results]:results [10]' \
+ '*: :_guard "^-*" "query"'
+ ;;
+
+ test)
+ _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
+ '--test=[test name]: :_cargo_test_names' \
+ '--no-fail-fast[run all tests regardless of failure]' \
+ '--no-run[compile but do not run]' \
+ '(-p --package)'{-p+,--package=}'[package to run tests for]:package:_cargo_package_names' \
+ '--all[test all packages in the workspace]' \
+ '--release[build artifacts in release mode, with optimizations]' \
+ '1: :_cargo_test_names' \
+ '(--doc --bin --example --test --bench)--lib[only test library]' \
+ '(--lib --bin --example --test --bench)--doc[only test documentation]' \
+ '(--lib --doc --example --test --bench)--bin=[binary name]' \
+ '(--lib --doc --bin --test --bench)--example=[example name]' \
+ '(--lib --doc --bin --example --bench)--test=[test name]' \
+ '(--lib --doc --bin --example --test)--bench=[benchmark name]' \
+ '*: :_default'
+ ;;
+
+ uninstall)
+ _arguments -s -S $common \
+ '(-p --package)'{-p+,--package=}'[specify package to uninstall]:package:_cargo_package_names' \
+ '--bin=[only uninstall the specified binary]:name' \
+ '--root=[directory to uninstall packages from]: :_files -/' \
+ '*:crate:_cargo_installed_crates -F line'
+ ;;
+
+ update)
+ _arguments -s -S $common $manifest \
+ '--aggressive=[force dependency update]' \
+ "--dry-run[don't actually write the lockfile]" \
+ '(-p --package)'{-p+,--package=}'[specify package to update]:package:_cargo_package_names' \
+ '--precise=[update single dependency to precise release]:release'
+ ;;
+
+ verify-project)
+ _arguments -s -S $common $manifest
+ ;;
+
+ version)
+ _arguments -s -S $common
+ ;;
+
+ yank)
+ _arguments -s -S $common $registry \
+ '--vers=[specify yank version]:version' \
+ '--undo[undo a yank, putting a version back into the index]' \
+ '--index=[specify registry index to yank from]:registry index' \
+ '--token=[specify API token to use when authenticating]:token' \
+ '*: :_guard "^-*" "crate"'
+ ;;
+ *)
+ # allow plugins to define their own functions
+ if ! _call_function ret _cargo-${words[1]}; then
+ # fallback on default completion for unknown commands
+ _default && ret=0
+ fi
+ (( ! ret ))
+ ;;
+ esac
+ ;;
+ esac
+}
+
+_cargo_unstable_flags() {
+ local flags
+ flags=( help ${${${(M)${(f)"$(_call_program flags cargo -Z help)"}:#*--*}/ #-- #/:}##*-Z } )
+ _describe -t flags 'unstable flag' flags
}
-_cargo_cmds(){
-local -a commands;commands=(
-'bench:execute all benchmarks of a local package'
-'build:compile the current package'
-'check:check the current package without compiling'
-'clean:remove generated artifacts'
-'doc:build package documentation'
-'fetch:fetch package dependencies'
-'generate-lockfile:create lockfile'
-'git-checkout:git checkout'
-'help:get help for commands'
-'init:create new package in current directory'
-'install:install a Rust binary'
-'locate-project:print "Cargo.toml" location'
-'login:login to remote server'
-'metadata:the metadata for a package in json'
-'new:create a new package'
-'owner:manage the owners of a crate on the registry'
-'package:assemble local package into a distributable tarball'
-'pkgid:print a fully qualified package specification'
-'publish:upload package to the registry'
-'read-manifest:print manifest in JSON format'
-'run:run the main binary of the local package'
-'rustc:compile a package and all of its dependencies'
-'rustdoc:build documentation for a package'
-'search:search packages on crates.io'
-'test:execute all unit and tests of a local package'
-'uninstall:remove a Rust binary'
-'update:update dependencies'
-'verify-project:check Cargo.toml'
-'version:show version information'
-'yank:remove pushed file from index'
-)
-_describe -t common-commands 'common commands' commands
+_cargo_installed_crates() {
+ local expl
+ _description crates expl 'crate'
+ compadd "$@" "$expl[@]" - ${${${(f)"$(cargo install --list)"}:# *}%% *}
}
-_cargo_all_cmds(){
-local -a commands;commands=($(cargo --list))
-_describe -t all-commands 'all commands' commands
+_cargo_cmds() {
+ local -a commands
+ # This uses Parameter Expansion Flags, which are a built-in Zsh feature.
+ # See more: http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
+ # and http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion
+ #
+ # # How this work?
+ #
+ # First it splits the result of `cargo --list` at newline, then it removes the first line.
+ # Then it removes indentation (4 whitespaces) before each items. (Note the x## pattern [1]).
+ # Then it replaces those spaces between item and description with a `:`
+ #
+ # [1]: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org#patterns
+ commands=( ${${${(M)"${(f)$(_call_program commands cargo --list)}":# *}/ ##/}/ ##/:} )
+ _describe -t commands 'command' commands
}
#FIXME: Disabled until fixed
#gets package names from the manifest file
-_get_package_names()
-{
-}
-
-#TODO:see if it makes sense to have 'locate-project' to have non-json output.
-#strips package name from json stuff
-_locate_manifest(){
-local manifest=`cargo locate-project 2>/dev/null`
-regexp-replace manifest '\{"root":"|"\}' ''
-echo $manifest
+_cargo_package_names() {
+ _message -e packages package
}
# Extracts the values of "name" from the array given in $1 and shows them as
# command line options for completion
-_get_names_from_array()
-{
- local -a filelist;
- local manifest=$(_locate_manifest)
+_cargo_names_from_array() {
+ # strip json from the path
+ local manifest=${${${"$(cargo locate-project)"}%\"\}}##*\"}
if [[ -z $manifest ]]; then
return 0
fi
@@ -494,51 +372,36 @@ _get_names_from_array()
local in_block=false
local block_name=$1
names=()
- while read line
- do
+ while read -r line; do
if [[ $last_line == "[[$block_name]]" ]]; then
in_block=true
else
- if [[ $last_line =~ '.*\[\[.*' ]]; then
+ if [[ $last_line =~ '\s*\[\[.*' ]]; then
in_block=false
fi
fi
if [[ $in_block == true ]]; then
- if [[ $line =~ '.*name.*=' ]]; then
- regexp-replace line '^.*name *= *|"' ""
- names+=$line
+ if [[ $line =~ '\s*name\s*=' ]]; then
+ regexp-replace line '^\s*name\s*=\s*|"' ''
+ names+=( "$line" )
fi
fi
last_line=$line
- done < $manifest
- _describe $block_name names
+ done < "$manifest"
+ _describe "$block_name" names
}
#Gets the test names from the manifest file
-_test_names()
-{
- _get_names_from_array "test"
+_cargo_test_names() {
+ _cargo_names_from_array "test"
}
#Gets the bench names from the manifest file
-_benchmark_names()
-{
- _get_names_from_array "bench"
+_cargo_benchmark_names() {
+ _cargo_names_from_array "bench"
}
-# These flags are mutually exclusive specifiers for the scope of a command; as
-# they are used in multiple places without change, they are expanded into the
-# appropriate command's `_arguments` where appropriate.
-set command_scope_spec
-command_scope_spec=(
- '(--bin --example --test --lib)--bench=[benchmark name]: :_benchmark_names'
- '(--bench --bin --test --lib)--example=[example name]'
- '(--bench --example --test --lib)--bin=[binary name]'
- '(--bench --bin --example --test)--lib=[library name]'
- '(--bench --bin --example --lib)--test=[test name]'
-)
-
_cargo
diff --git a/plugins/docker/README.md b/plugins/docker/README.md
index e91798485..4d9f3ae9b 100644
--- a/plugins/docker/README.md
+++ b/plugins/docker/README.md
@@ -1,5 +1,11 @@
-## Docker autocomplete plugin
+# Docker plugin
-A copy of the completion script from the
-[docker/cli](https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker)
-git repo.
+This plugin adds auto-completion for [docker](https://www.docker.com/).
+
+To use it add `docker` to the plugins array in your zshrc file.
+```zsh
+plugins=(... docker)
+```
+
+A copy of the completion script from the docker/cli git repo:
+https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker
diff --git a/plugins/eecms/README.md b/plugins/eecms/README.md
new file mode 100644
index 000000000..c53835521
--- /dev/null
+++ b/plugins/eecms/README.md
@@ -0,0 +1,11 @@
+# eecms plugin
+
+This plugin adds auto-completion of console commands for [`eecms`](https://github.com/ExpressionEngine/ExpressionEngine).
+
+To use it, add `eecms` to the plugins array of your `.zshrc` file:
+```
+plugins=(... eecms)
+```
+
+It also adds the alias `eecms` which finds the eecms file in the current project
+and runs it with php.
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index 646148297..fe471a363 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -1,9 +1,9 @@
function setup_using_base_dir() {
- # Declare all variables local not no mess with outside env in any way
- local fzf_base
- local fzf_shell
- local fzfdirs
- local dir
+ # Declare all variables local not no mess with outside env in any way
+ local fzf_base
+ local fzf_shell
+ local fzfdirs
+ local dir
test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}"
@@ -58,7 +58,7 @@ function setup_using_base_dir() {
function setup_using_debian_package() {
- dpkg -s fzf &> /dev/null
+ (( $+commands[dpkg] )) && dpkg -s fzf &> /dev/null
if (( $? )); then
# Either not a debian based distro, or no fzf installed. In any case skip ahead
return 1
diff --git a/plugins/git-remote-branch/README.md b/plugins/git-remote-branch/README.md
new file mode 100644
index 000000000..bd73e5dec
--- /dev/null
+++ b/plugins/git-remote-branch/README.md
@@ -0,0 +1,14 @@
+# git-remote-branch plugin
+
+This plugin adds completion for [`grb`](https://github.com/webmat/git_remote_branch),
+or `git_remote_branch`.
+
+To use it, add `git-remote-branch` to the plugins array of your `.zshrc` file:
+```
+plugins=(... git-remote-branch)
+```
+
+## Deprecation
+
+[git_remote_branch was archived in 2018](https://github.com/webmat/git_remote_branch#archived),
+meaning it's not actively maintained anymore. Use at your own risk.
diff --git a/plugins/magic-enter/Readme.md b/plugins/magic-enter/Readme.md
index b401ab415..78514c67d 100644
--- a/plugins/magic-enter/Readme.md
+++ b/plugins/magic-enter/Readme.md
@@ -1,14 +1,17 @@
-## Magic Enter
+## Magic Enter plugin
-**Maintainer:** [@dufferzafar](https://github.com/dufferzafar)
-
-Makes your enter key magical, by binding commonly used commands to it.
+This plugin makes your enter key magical, by binding commonly used commands to it.
-You can set the commands to be run in your .zshrc, before the line containing plugins!
+To use it, add `magic-enter` to the plugins array in your zshrc file. You can set the
+commands to be run in your .zshrc, before the line containing plugins. If no command
+is specified in a git directory, `git status` is executed; in other directories, `ls`.
-```bash
+```zsh
+# defaults
MAGIC_ENTER_GIT_COMMAND='git status -u .'
MAGIC_ENTER_OTHER_COMMAND='ls -lh .'
-plugins=(magic-enter)
+plugins=(... magic-enter)
```
+
+**Maintainer:** [@dufferzafar](https://github.com/dufferzafar)
diff --git a/plugins/pass/README.md b/plugins/pass/README.md
new file mode 100644
index 000000000..2b0704981
--- /dev/null
+++ b/plugins/pass/README.md
@@ -0,0 +1,22 @@
+# pass
+
+This plugin provides completion for the [pass](https://www.passwordstore.org/) password manager.
+
+To use it, add `pass` to the plugins array in your zshrc file.
+
+```
+plugins=(... pass)
+```
+
+## Configuration
+
+### Multiple repositories
+
+If you use multiple repositories, you can configure completion like this:
+```zsh
+compdef _pass workpass
+zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass"
+workpass() {
+ PASSWORD_STORE_DIR=$HOME/work/pass pass $@
+}
+```
diff --git a/plugins/phing/README.md b/plugins/phing/README.md
new file mode 100644
index 000000000..e2ac0bdf5
--- /dev/null
+++ b/plugins/phing/README.md
@@ -0,0 +1,8 @@
+# Phing plugin
+
+This plugin adds autocompletion for [`phing`](https://github.com/phingofficial/phing) targets.
+
+To use it, add `phing` to the plugins array of your `.zshrc` file:
+```
+plugins=(... eecms)
+```
diff --git a/plugins/pod/README.md b/plugins/pod/README.md
new file mode 100644
index 000000000..0a3cc7a36
--- /dev/null
+++ b/plugins/pod/README.md
@@ -0,0 +1,10 @@
+# pod
+
+This plugin adds completion for [`CocoaPods`](https://cocoapods.org/).
+CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects.
+
+To use it, add `pod` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... pod)
+```
diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
index a8ec79db2..1fd5f0f86 100644
--- a/plugins/rails/rails.plugin.zsh
+++ b/plugins/rails/rails.plugin.zsh
@@ -17,7 +17,7 @@ function _rake_command () {
bin/stubs/rake $@
elif [ -e "bin/rake" ]; then
bin/rake $@
- elif type bundle &> /dev/null && [ -e "Gemfile" ]; then
+ elif type bundle &> /dev/null && ([ -e "Gemfile" ] || [ -e "gems.rb" ]); then
bundle exec rake $@
else
command rake $@
diff --git a/plugins/rake/README.md b/plugins/rake/README.md
new file mode 100644
index 000000000..e235bd91a
--- /dev/null
+++ b/plugins/rake/README.md
@@ -0,0 +1,37 @@
+# Rake plugin
+
+This plugin adds support for [rake](https://ruby.github.io/rake/), the Ruby
+build tool or Ruby Make.
+
+To use it, add `rake` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... rake)
+```
+
+## Aliases
+
+The plugin aliases the rake command so you can pass arguments when invoking rake tasks
+without having to escape the brackets, i.e., you can run
+```
+rake namespace:task['argument']
+```
+instead of having to do
+```
+rake namespace:task\['argument'\]
+```
+
+| Alias | Command | Description |
+|--------|--------------------------------|-----------------------------------------------|
+| rake | `noglob rake` | Allows unescaped square brackets |
+| brake | `noglob bundle exec rake` | Same as above but call rake using bundler |
+| srake | `noglob sudo rake` | Same as rake but using sudo |
+| sbrake | `noglob sudo bundle exec rake` | Same as above but using both sudo and bundler |
+
+## Jim Weirich
+
+The plugin also aliases `rake` to [`jimweirich`](https://github.com/jimweirich), author of Rake
+and big time contributor to the Ruby open source community. He passed away in 2014:
+
+> Thank you Jim for everything you contributed to the Ruby and open source community
+> over the years. We will miss you dearly. — [**@robbyrussell**](https://github.com/robbyrussell/oh-my-zsh/commit/598a9c6f990756386517d66b6bcf77e53791e905)
diff --git a/plugins/rbenv/README.md b/plugins/rbenv/README.md
new file mode 100644
index 000000000..43a2e93ac
--- /dev/null
+++ b/plugins/rbenv/README.md
@@ -0,0 +1,26 @@
+# rbenv plugin
+
+The primary job of this plugin is to provide `rbenv_prompt_info` which can be added to your theme to include Ruby
+version and gemset information into your prompt.
+
+Some functionality of this plugin will not work unless you also have the rbenv plugin *gemset* installed.
+https://github.com/jf/rbenv-gemset
+
+To use it, add `rbenv` to the plugins array in your zshrc file:
+```zsh
+plugins=(... rbenv)
+```
+
+## Alias
+
+| Alias | Command | Description |
+|----------------|---------------------|----------------------------------|
+| rubies | `rbenv versions` | List the installed Ruby versions |
+| gemsets | `rbenv gemset list` | List the existing gemsets |
+
+## Functions
+
+* `current_ruby`: The version of Ruby currently being used.
+* `current_gemset`: The name of the current gemset.
+* `gems`: Lists installed gems with enhanced formatting and color.
+* `rbenv_prompt_info`: For adding information to your prompt. Format: `<ruby version>@<current gemset>`.
diff --git a/plugins/rust/README.md b/plugins/rust/README.md
new file mode 100644
index 000000000..83d7d91ba
--- /dev/null
+++ b/plugins/rust/README.md
@@ -0,0 +1,9 @@
+# rust
+
+This plugin adds completion for [`rustc`](https://doc.rust-lang.org/rustc/index.html), the compiler for the Rust programming language.
+
+To use it, add `rust` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... rust)
+```
diff --git a/plugins/safe-paste/README.md b/plugins/safe-paste/README.md
new file mode 100644
index 000000000..a2e7ddbfc
--- /dev/null
+++ b/plugins/safe-paste/README.md
@@ -0,0 +1,9 @@
+# safe-paste
+
+Preventing any code from actually running while pasting, so you have a chance to review what was actually pasted before running it.
+
+To use it, add `safe-paste` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... safe-paste)
+```
diff --git a/plugins/screen/README.md b/plugins/screen/README.md
new file mode 100644
index 000000000..103e17237
--- /dev/null
+++ b/plugins/screen/README.md
@@ -0,0 +1,10 @@
+# screen
+
+This plugin sets title and hardstatus of the tab window for [screen](https://www.gnu.org/software/screen/),
+the terminal multiplexer.
+
+To use it add `screen` to the plugins array in your zshrc file.
+
+```zsh
+plugins=(... screen)
+```
diff --git a/plugins/supervisor/README.md b/plugins/supervisor/README.md
new file mode 100644
index 000000000..1eacea6d3
--- /dev/null
+++ b/plugins/supervisor/README.md
@@ -0,0 +1,12 @@
+# supervisor plugin
+
+This plugin adds tab-completion for `supervisord`/`supervisorctl` in [Supervisor](http://supervisord.org/).
+Supervisor is a client/server system that allows its users to monitor and control a number
+of processes on UNIX-like operating systems.
+
+To use it, add `supervisor` to the plugins array in your zshrc file:
+```zsh
+plugins=(... supervisor)
+```
+
+These scripts are from [zshcompfunc4supervisor](https://bitbucket.org/hhatto/zshcompfunc4supervisor).
diff --git a/plugins/supervisor/_supervisorctl b/plugins/supervisor/_supervisorctl
index d159f20e0..9f576c0c0 100644
--- a/plugins/supervisor/_supervisorctl
+++ b/plugins/supervisor/_supervisorctl
@@ -112,6 +112,13 @@ _supervisorctl_start() {
'*::supvervisor process:_get_supervisor_procs'
}
+(( $+functions[_supervisorctl_restart] )) ||
+_supervisorctl_restart() {
+ # TODO: add 'all'
+ _arguments -s \
+ '*::supvervisor process:_get_supervisor_procs'
+}
+
(( $+functions[_supervisorctl_status] )) ||
_supervisorctl_status() {
_arguments \