-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathCargo.rb
More file actions
204 lines (193 loc) · 6.77 KB
/
Copy pathCargo.rb
File metadata and controls
204 lines (193 loc) · 6.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
cheatsheet do
title 'Cargo'
docset_file_name 'Cargo'
keyword 'cargo'
source_url 'http://cheat.kapeli.com'
introduction <<-'END'
Handy cheat sheet for Rust package manager Cargo (`cargo`)
Based on Cargo version:
```bash
$ cargo --version
cargo 1.29.0 (524a578d7 2018-08-05)
```
END
category do
id 'Usage'
entry do
command '--version'
name 'Shows version information, hash and date, see also the introduction above'
end
entry do
command '--list'
name 'Lists all installed and available commands'
end
entry do
command '--verbose'
name 'Enable verbose output. Shorthand -v and -vv for more (very) verbose output'
end
entry do
command '--quiet'
name 'Disable output on STDOUT'
end
entry do
command '--color WHEN'
name 'Enable colours, auto, always or never'
end
entry do
command '--help'
name 'Shows help message'
end
entry do
command '--locked'
name 'Require Cargo.lock is up to date'
end
entry do
command '--frozen'
name 'Require Cargo.lock and cache are up to date is up to date'
end
entry do
command '-Z FLAG'
name 'Unstable (nightly-only) flags to Cargo, see "cargo -Z help" for details for further information on unstable flags'
end
entry do
command '--explain CODE'
name 'Executes `rustc --explain CODE`'
end
end
category do
id 'Start a Rust Project'
entry do
command 'new --bin APPLICATIONNAME'
name 'Create new application/executable based project'
end
entry do
command 'new --lib LIBRARYNAME'
name 'Create new library based project, this is actually the default and `--lib` can be omitted'
end
entry do
command 'init --bin'
name 'Initialize a new application/executable in current directory'
end
entry do
command 'init --lib'
name 'Initialize a library in current directory'
end
end
category do
id 'Build a Rust Project'
entry do
command 'build'
name 'Build a Rust project'
end
entry do
command 'build -j JOBS'
name 'Build a Rust project in parallel with mutiple jobs'
end
entry do
command 'run'
name 'Executes benchmark of project, requires tests'
end
entry do
command 'bench'
name 'Executes benchmark of project, requires tests'
end
entry do
command 'check'
name 'Analyze the current project and report possible errors, but does not build object files'
end
entry do
command 'test'
name 'Executes project tests, requires tests'
end
entry do
command 'doc'
name 'Builds projects documentation, requires inlines documentation in source files'
end
entry do
command 'clean'
name 'Clean out the build, by removing the target/ directory'
end
end
category do
id 'Maintain a Rust Project'
entry do
command 'search'
name 'Search for crates'
end
entry do
command 'install'
name 'Install a Rust binary'
end
entry do
command 'install CREATENAME'
name 'Install a named crate, see search above'
end
entry do
command 'fetch --list'
name 'Lists installed crates'
end
entry do
command 'install --list'
name 'Lists installed crates'
end
end
category do
id 'Maintain a Rust Crate'
entry do
command 'package'
name 'Package this project into a distributable tarball'
end
entry do
command 'publish'
name 'Upload a package to the registry'
end
entry do
command 'yank'
name 'Remove a pushed crate from the index'
end
end
category do
id 'Environment Variables'
entry do
command 'CARGO_HOME'
name 'Cargo maintains a local cache of the registry index and of git checkouts of crates. By default these are stored under `$HOME/.cargo`, this variable overrides the location of this directory. Once a crate is cached it will not removed by the clean command'
end
entry do
command 'CARGO_TARGET_DIR'
name 'Location of where to place generated artifacts, relative to the current working directory'
end
entry do
command 'RUSTC'
name 'Instead of running rustc, Cargo will execute specified compiler instead'
end
entry do
command 'RUSTC_WRAPPER'
name 'Instead of running rustc, Cargo will execute specified wrapper instead, passing as its commandline arguments the rustc invocation, with the first argument being rustc'
end
entry do
command 'RUSTDOC'
name 'Instead of running rustdoc, Cargo will execute specified rustdoc instance'
end
entry do
command 'RUSTDOCFLAGS'
name 'A space-separated list of custom flags to pass to rustdoc invocations that Cargo performs. In contrast to cargo rustdoc, this is useful for passing a flag to all rustdoc instances'
end
entry do
command 'RUSTFLAGS'
name 'A space-separated list of custom flags to pass to compiler invocations that Cargo performs. In contrast to cargo rustc, this is useful for passing a flag to all compiler instances'
end
entry do
command 'CARGO_INCREMENTAL'
name 'If set to 1 then Cargo will force incremental compilation to be enabled for the current compilation, and when set to 0 it will force disabling it. If this env var is not present then Cargo defaults will be used'
end
entry do
command 'CARGO_CACHE_RUSTC_INFO'
name 'If set to 0 then Cargo will not attempt to cache compiler version information'
end
end
notes <<-'END'
* For more information on Cargo see the [official documentation](https://doc.rust-lang.org/stable/cargo/)
* For more information on the Cargo environment variables see the [official documentation](https://doc.rust-lang.org/stable/cargo/reference/environment-variables.html)
* For access to the Cargo source code, visit [the repository on GitHub](https://github.com/rust-lang/cargo/)
END
end