16074a1c4d33da44e3007f8b99a27939bcade9cf
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/cargo/README.md b/plugins/cargo/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..5fa688d21d150f9b0d35d3fd797e45efbb75f487
4--- /dev/null
5+++ b/plugins/cargo/README.md
6@@ -0,0 +1,11 @@
7+# cargo
8+
9+This plugin adds completion for the Rust build tool [`cargo`](https://github.com/rust-lang/cargo).
10+
11+To use it, add `cargo` to the plugins array in your zshrc file:
12+
13+```zsh
14+plugins=(... cargo)
15+```
16+
17+Updated on October 4th, 2016.
18diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo
19new file mode 100644
20index 0000000000000000000000000000000000000000..17585920252a7919d87a35e18e579460b3f9490a
21--- /dev/null
22+++ b/plugins/cargo/_cargo
23@@ -0,0 +1,497 @@
24+#compdef cargo
25+
26+typeset -A opt_args
27+autoload -U regexp-replace
28+
29+_cargo() {
30+
31+_arguments \
32+ '(- 1 *)'{-h,--help}'[show help message]' \
33+ '(- 1 *)'--list'[list installed commands]' \
34+ '(- 1 *)'{-v,--verbose}'[use verbose output]' \
35+ '(- 1 *)'--color'[colorization option]' \
36+ '(- 1 *)'{-V,--version}'[show version information]' \
37+ '1: :_cargo_cmds' \
38+ '*:: :->args'
39+
40+case $state in
41+ args)
42+ case $words[1] in
43+ bench)
44+ _arguments \
45+ '--features=[space separated feature list]' \
46+ '--all-features[enable all available features]' \
47+ '(-h, --help)'{-h,--help}'[show help message]' \
48+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
49+ "${command_scope_spec[@]}" \
50+ '--manifest-path=[path to manifest]: :_files -/' \
51+ '--no-default-features[do not build the default features]' \
52+ '--no-run[compile but do not run]' \
53+ '(-p,--package)'{-p=,--package=}'[package to run benchmarks for]:packages:_get_package_names' \
54+ '--target=[target triple]' \
55+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
56+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
57+ '--color=:colorization option:(auto always never)' \
58+ ;;
59+
60+ build)
61+ _arguments \
62+ '--features=[space separated feature list]' \
63+ '--all-features[enable all available features]' \
64+ '(-h, --help)'{-h,--help}'[show help message]' \
65+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
66+ "${command_scope_spec[@]}" \
67+ '--manifest-path=[path to manifest]: :_files -/' \
68+ '--no-default-features[do not build the default features]' \
69+ '(-p,--package)'{-p=,--package=}'[package to build]:packages:_get_package_names' \
70+ '--release=[build in release mode]' \
71+ '--target=[target triple]' \
72+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
73+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
74+ '--color=:colorization option:(auto always never)' \
75+ ;;
76+
77+ clean)
78+ _arguments \
79+ '(-h, --help)'{-h,--help}'[show help message]' \
80+ '--manifest-path=[path to manifest]: :_files -/' \
81+ '(-p,--package)'{-p=,--package=}'[package to clean]:packages:_get_package_names' \
82+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
83+ '--release[whether or not to clean release artifacts]' \
84+ '--target=[target triple(default:all)]' \
85+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
86+ '--color=:colorization option:(auto always never)' \
87+ ;;
88+
89+ doc)
90+ _arguments \
91+ '--features=[space separated feature list]' \
92+ '--all-features[enable all available features]' \
93+ '(-h, --help)'{-h,--help}'[show help message]' \
94+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
95+ '--manifest-path=[path to manifest]: :_files -/' \
96+ '--no-deps[do not build docs for dependencies]' \
97+ '--no-default-features[do not build the default features]' \
98+ '--open[open docs in browser after the build]' \
99+ '(-p, --package)'{-p,--package}'=[package to document]' \
100+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
101+ '--release[build artifacts in release mode, with optimizations]' \
102+ '--target=[build for the target triple]' \
103+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
104+ '--color=:colorization option:(auto always never)' \
105+ ;;
106+
107+ fetch)
108+ _arguments \
109+ '(-h, --help)'{-h,--help}'[show help message]' \
110+ '--manifest-path=[path to manifest]: :_files -/' \
111+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
112+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
113+ '--color=:colorization option:(auto always never)' \
114+ ;;
115+
116+ generate-lockfile)
117+ _arguments \
118+ '(-h, --help)'{-h,--help}'[show help message]' \
119+ '--manifest-path=[path to manifest]: :_files -/' \
120+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
121+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
122+ '--color=:colorization option:(auto always never)' \