-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrustup.sh
421 lines (374 loc) · 12.9 KB
/
rustup.sh
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
#!/usr/bin/env bash
# Automatic generated, DON'T MODIFY IT.
# @flag -v --verbose Enable verbose output
# @flag -q --quiet Disable progress output
# @flag -h --help Print help
# @flag -V --version Print version
# {{ rustup show
# @cmd Show the active and installed toolchains or profiles
# @flag -v --verbose Enable verbose output with rustc information for all installed toolchains
# @flag -h --help Print help
show() {
:;
}
# {{{ rustup show active-toolchain
# @cmd Show the active toolchain
# @flag -v --verbose Enable verbose output with rustc information
# @flag -h --help Print help
show::active-toolchain() {
:;
}
# }}} rustup show active-toolchain
# {{{ rustup show home
# @cmd Display the computed value of RUSTUP_HOME
# @flag -h --help Print help
show::home() {
:;
}
# }}} rustup show home
# {{{ rustup show profile
# @cmd Show the default profile used for the `rustup install` command
# @flag -h --help Print help
show::profile() {
:;
}
# }}} rustup show profile
# }} rustup show
# {{ rustup update
# @cmd Update Rust toolchains and rustup
# @flag --no-self-update Don't perform self update when running the `rustup update` command
# @flag --force Force an update, even if some components are missing
# @flag --force-non-host Install toolchains that require an emulator.
# @flag -h --help Print help
# @arg toolchain*[`_choice_channel`] Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
update() {
:;
}
# }} rustup update
# {{ rustup check
# @cmd Check for updates to Rust toolchains and rustup
# @flag -h --help Print help
check() {
:;
}
# }} rustup check
# {{ rustup default
# @cmd Set the default toolchain
# @flag -h --help Print help
# @arg toolchain[`_choice_toolchain`] 'none', a toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name.
default() {
:;
}
# }} rustup default
# {{ rustup toolchain
# @cmd Modify or query the installed toolchains
# @flag -h --help Print help
toolchain() {
:;
}
# {{{ rustup toolchain list
# @cmd List installed toolchains
# @flag -v --verbose Enable verbose output with toolchain information
# @flag -h --help Print help
toolchain::list() {
:;
}
# }}} rustup toolchain list
# {{{ rustup toolchain install
# @cmd Install or update a given toolchain
# @option --profile[minimal|default|complete] <profile>
# @option -c --component*,[`_choice_available_component`] <components> Add specific components on installation
# @option -t --target*[`_choice_target`] <targets> Add specific targets on installation
# @flag --no-self-update Don't perform self update when running the`rustup toolchain install` command
# @flag --force Force an update, even if some components are missing
# @flag --allow-downgrade Allow rustup to downgrade the toolchain to satisfy your component choice
# @flag --force-non-host Install toolchains that require an emulator.
# @flag -h --help Print help
# @arg toolchain+[`_choice_channel`] Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
toolchain::install() {
:;
}
# }}} rustup toolchain install
# {{{ rustup toolchain uninstall
# @cmd Uninstall a toolchain
# @flag -h --help Print help
# @arg toolchain+[`_choice_toolchain`] Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name.
toolchain::uninstall() {
:;
}
# }}} rustup toolchain uninstall
# {{{ rustup toolchain link
# @cmd Create a custom toolchain by symlinking to a directory
# @flag -h --help Print help
# @arg toolchain![`_choice_toolchain`] Custom toolchain name
# @arg path! Path to the directory
toolchain::link() {
:;
}
# }}} rustup toolchain link
# }} rustup toolchain
# {{ rustup target
# @cmd Modify a toolchain's supported targets
# @flag -h --help Print help
target() {
:;
}
# {{{ rustup target list
# @cmd List installed and available targets
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
# @flag --installed List only installed targets
# @flag -h --help Print help
target::list() {
:;
}
# }}} rustup target list
# {{{ rustup target add
# @cmd Add a target to a Rust toolchain
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
# @flag -h --help Print help
# @arg target+[`_choice_target`] List of targets to install; "all" installs all available targets
target::add() {
:;
}
# }}} rustup target add
# {{{ rustup target remove
# @cmd Remove a target from a Rust toolchain
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
# @flag -h --help Print help
# @arg target+[`_choice_target`] List of targets to uninstall
target::remove() {
:;
}
# }}} rustup target remove
# }} rustup target
# {{ rustup component
# @cmd Modify a toolchain's installed components
# @flag -h --help Print help
component() {
:;
}
# {{{ rustup component list
# @cmd List installed and available components
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
# @flag --installed List only installed components
# @flag -h --help Print help
component::list() {
:;
}
# }}} rustup component list
# {{{ rustup component add
# @cmd Add a component to a Rust toolchain
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
# @option --target[`_choice_target`] <target>
# @flag -h --help Print help
# @arg component+[`_choice_available_component`]
component::add() {
:;
}
# }}} rustup component add
# {{{ rustup component remove
# @cmd Remove a component from a Rust toolchain
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
# @option --target[`_choice_target`] <target>
# @flag -h --help Print help
# @arg component+[`_choice_installed_component`]
component::remove() {
:;
}
# }}} rustup component remove
# }} rustup component
# {{ rustup override
# @cmd Modify toolchain overrides for directories
# @flag -h --help Print help
override() {
:;
}
# {{{ rustup override list
# @cmd List directory toolchain overrides
# @flag -h --help Print help
override::list() {
:;
}
# }}} rustup override list
# {{{ rustup override set
# @cmd Set the override toolchain for a directory
# @option --path <path> Path to the directory
# @flag -h --help Print help
# @arg toolchain![`_choice_toolchain`] Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name.
override::set() {
:;
}
# }}} rustup override set
# {{{ rustup override unset
# @cmd Remove the override toolchain for a directory
# @option --path[`_choice_override`] <path> Path to the directory
# @flag --nonexistent Remove override toolchain for all nonexistent directories
# @flag -h --help Print help
override::unset() {
:;
}
# }}} rustup override unset
# }} rustup override
# {{ rustup run
# @cmd Run a command with an environment configured for a given toolchain
# @flag --install Install the requested toolchain if needed
# @flag -h --help Print help
# @arg toolchain![`_choice_toolchain`] Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name, or an absolute path.
# @arg command+[`_choice_toolchain_command`]
run() {
:;
}
# }} rustup run
# {{ rustup which
# @cmd Display which binary will be run for a given command
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name.
# @flag -h --help Print help
# @arg command![`_choice_toolchain_command`]
which() {
:;
}
# }} rustup which
# {{ rustup doc
# @cmd Open the documentation for the current toolchain
# @flag --path Only print the path to the documentation
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
# @flag --alloc The Rust core allocation and collections library
# @flag --book The Rust Programming Language book
# @flag --cargo The Cargo Book
# @flag --core The Rust Core Library
# @flag --edition-guide The Rust Edition Guide
# @flag --nomicon The Dark Arts of Advanced and Unsafe Rust Programming
# @flag --proc_macro A support library for macro authors when defining new macros
# @flag --reference The Rust Reference
# @flag --rust-by-example A collection of runnable examples that illustrate various Rust concepts and standard libraries
# @flag --rustc The compiler for the Rust programming language
# @flag --rustdoc Documentation generator for Rust projects
# @flag --std Standard library API documentation
# @flag --test Support code for rustc's built in unit-test and micro-benchmarking framework
# @flag --unstable-book The Unstable Book
# @flag --embedded-book The Embedded Rust Book
# @flag -h --help Print help
# @arg topic Topic such as 'core', 'fn', 'usize', 'eprintln!', 'core::arch', 'alloc::format!', 'std::fs', 'std::fs::read_dir', 'std::io::Bytes', 'std::iter::Sum', 'std::io::error::Result' etc...
doc() {
:;
}
# }} rustup doc
# {{ rustup man
# @cmd View the man page for a given command
# @option --toolchain[`_choice_toolchain`] <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'.
# @flag -h --help Print help
# @arg command![`_choice_toolchain_command`]
man() {
:;
}
# }} rustup man
# {{ rustup self
# @cmd Modify the rustup installation
# @flag -h --help Print help
self() {
:;
}
# {{{ rustup self update
# @cmd Download and install updates to rustup
# @flag -h --help Print help
self::update() {
:;
}
# }}} rustup self update
# {{{ rustup self uninstall
# @cmd Uninstall rustup.
# @flag -y
# @flag -h --help Print help
self::uninstall() {
:;
}
# }}} rustup self uninstall
# {{{ rustup self upgrade-data
# @cmd Upgrade the internal data format.
# @flag -h --help Print help
self::upgrade-data() {
:;
}
# }}} rustup self upgrade-data
# }} rustup self
# {{ rustup set
# @cmd Alter rustup settings
# @flag -h --help Print help
set() {
:;
}
# {{{ rustup set default-host
# @cmd The triple used to identify toolchains when not specified
# @flag -h --help Print help
# @arg host_triple!
set::default-host() {
:;
}
# }}} rustup set default-host
# {{{ rustup set profile
# @cmd The default components installed with a toolchain
# @flag -h --help Print help
# @arg profile-name![minimal|default|complete] [default: default]
set::profile() {
:;
}
# }}} rustup set profile
# {{{ rustup set auto-self-update
# @cmd The rustup auto self update mode
# @flag -h --help Print help
# @arg auto-self-update-mode![enable|disable|check-only] [default: enable]
set::auto-self-update() {
:;
}
# }}} rustup set auto-self-update
# }} rustup set
# {{ rustup completions
# @cmd Generate tab-completion scripts for your shell
# @flag -h --help Print help
# @arg shell[bash|elvish|fish|powershell|zsh]
# @arg command[rustup|cargo]
completions() {
:;
}
# }} rustup completions
. "$ARGC_COMPLETIONS_ROOT/utils/_argc_utils.sh"
_choice_channel() {
echo stable
echo beta
echo nightly
}
_choice_toolchain() {
_choice_channel
rustup toolchain list | gawk '{print $1}'
}
_choice_available_component() {
cat <<-'EOF'
rustc The Rust compiler.
cargo Cargo is a package manager and build tool.
rustfmt Rustfmt is a tool for automatically formatting code.
rust-std This is the Rust standard library.
rust-docs This is a local copy of the Rust documentation.
rls RLS is a language server
rust-analyzer-preview Rust anaylzer is a new language server.
clippy Clippy is a lint tool.
miri Miri is an experimental Rust interpreter.
rust-src This is a local copy of the source code of the Rust standard library.
rust-analysis Metadata about the standard library, used by tools like RLS.
rust-mingw This contains a linker and platform libraries.
llvm-tools-preview This contains a collection of LLVM tools.
rustc-dev This component contains the compiler as a library.
EOF
}
_choice_target() {
rustup target list | gawk '{print $1}' | _argc_util_comp_parts -
}
_choice_installed_component() {
rustup component list --installed
}
_choice_override() {
rustup override list
}
_choice_toolchain_command() {
printf "%s\n" cargo cargo-clippy cargo-fmt clippy-driver rustc rustdoc rustfmt rust-gdb rust-gdbgui rust-lldb
}
command eval "$(argc --argc-eval "$0" "$@")"