Skip to content

Commit 299514d

Browse files
committed
Auto merge of #8455 - ehuss:rustup-toolchain, r=Eh2406
Add some help about rustup's +toolchain syntax. This tries to bring more attention to the `+toolchain` syntax from rustup. Closes #8058
2 parents f236c35 + 337fd9f commit 299514d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+597
-43
lines changed

src/bin/cargo/cli.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,20 @@ impl GlobalArgs {
256256
}
257257

258258
fn cli() -> App {
259+
let is_rustup = std::env::var_os("RUSTUP_HOME").is_some();
260+
let usage = if is_rustup {
261+
"cargo [+toolchain] [OPTIONS] [SUBCOMMAND]"
262+
} else {
263+
"cargo [OPTIONS] [SUBCOMMAND]"
264+
};
259265
App::new("cargo")
260266
.settings(&[
261267
AppSettings::UnifiedHelpMessage,
262268
AppSettings::DeriveDisplayOrder,
263269
AppSettings::VersionlessSubcommands,
264270
AppSettings::AllowExternalSubcommands,
265271
])
272+
.usage(usage)
266273
.template(
267274
"\
268275
Rust's package manager

src/doc/man/generated/cargo-bench.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,14 @@ <h3 id="cargo_bench_manifest_options">Manifest Options</h3>
419419
<h3 id="cargo_bench_common_options">Common Options</h3>
420420
<div class="dlist">
421421
<dl>
422+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
423+
<dd>
424+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
425+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
426+
as <code>+stable</code> or <code>+nightly</code>).
427+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
428+
for more information about how toolchain overrides work.</p>
429+
</dd>
422430
<dt class="hdlist1"><strong>-h</strong></dt>
423431
<dt class="hdlist1"><strong>--help</strong></dt>
424432
<dd>

src/doc/man/generated/cargo-build.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ <h3 id="cargo_build_manifest_options">Manifest Options</h3>
350350
<h3 id="cargo_build_common_options">Common Options</h3>
351351
<div class="dlist">
352352
<dl>
353+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
354+
<dd>
355+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
356+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
357+
as <code>+stable</code> or <code>+nightly</code>).
358+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
359+
for more information about how toolchain overrides work.</p>
360+
</dd>
353361
<dt class="hdlist1"><strong>-h</strong></dt>
354362
<dt class="hdlist1"><strong>--help</strong></dt>
355363
<dd>

src/doc/man/generated/cargo-check.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,14 @@ <h3 id="cargo_check_manifest_options">Manifest Options</h3>
341341
<h3 id="cargo_check_common_options">Common Options</h3>
342342
<div class="dlist">
343343
<dl>
344+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
345+
<dd>
346+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
347+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
348+
as <code>+stable</code> or <code>+nightly</code>).
349+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
350+
for more information about how toolchain overrides work.</p>
351+
</dd>
344352
<dt class="hdlist1"><strong>-h</strong></dt>
345353
<dt class="hdlist1"><strong>--help</strong></dt>
346354
<dd>

src/doc/man/generated/cargo-clean.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ <h3 id="cargo_clean_manifest_options">Manifest Options</h3>
170170
<h3 id="cargo_clean_common_options">Common Options</h3>
171171
<div class="dlist">
172172
<dl>
173+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
174+
<dd>
175+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
176+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
177+
as <code>+stable</code> or <code>+nightly</code>).
178+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
179+
for more information about how toolchain overrides work.</p>
180+
</dd>
173181
<dt class="hdlist1"><strong>-h</strong></dt>
174182
<dt class="hdlist1"><strong>--help</strong></dt>
175183
<dd>

src/doc/man/generated/cargo-doc.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,14 @@ <h3 id="cargo_doc_manifest_options">Manifest Options</h3>
311311
<h3 id="cargo_doc_common_options">Common Options</h3>
312312
<div class="dlist">
313313
<dl>
314+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
315+
<dd>
316+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
317+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
318+
as <code>+stable</code> or <code>+nightly</code>).
319+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
320+
for more information about how toolchain overrides work.</p>
321+
</dd>
314322
<dt class="hdlist1"><strong>-h</strong></dt>
315323
<dt class="hdlist1"><strong>--help</strong></dt>
316324
<dd>

src/doc/man/generated/cargo-fetch.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ <h3 id="cargo_fetch_manifest_options">Manifest Options</h3>
147147
<h3 id="cargo_fetch_common_options">Common Options</h3>
148148
<div class="dlist">
149149
<dl>
150+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
151+
<dd>
152+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
153+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
154+
as <code>+stable</code> or <code>+nightly</code>).
155+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
156+
for more information about how toolchain overrides work.</p>
157+
</dd>
150158
<dt class="hdlist1"><strong>-h</strong></dt>
151159
<dt class="hdlist1"><strong>--help</strong></dt>
152160
<dd>

src/doc/man/generated/cargo-fix.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,14 @@ <h3 id="cargo_fix_manifest_options">Manifest Options</h3>
417417
<h3 id="cargo_fix_common_options">Common Options</h3>
418418
<div class="dlist">
419419
<dl>
420+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
421+
<dd>
422+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
423+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
424+
as <code>+stable</code> or <code>+nightly</code>).
425+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
426+
for more information about how toolchain overrides work.</p>
427+
</dd>
420428
<dt class="hdlist1"><strong>-h</strong></dt>
421429
<dt class="hdlist1"><strong>--help</strong></dt>
422430
<dd>

src/doc/man/generated/cargo-generate-lockfile.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ <h3 id="cargo_generate_lockfile_manifest_options">Manifest Options</h3>
115115
<h3 id="cargo_generate_lockfile_common_options">Common Options</h3>
116116
<div class="dlist">
117117
<dl>
118+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
119+
<dd>
120+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
121+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
122+
as <code>+stable</code> or <code>+nightly</code>).
123+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
124+
for more information about how toolchain overrides work.</p>
125+
</dd>
118126
<dt class="hdlist1"><strong>-h</strong></dt>
119127
<dt class="hdlist1"><strong>--help</strong></dt>
120128
<dd>

src/doc/man/generated/cargo-init.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ <h3 id="cargo_init_display_options">Display Options</h3>
187187
<h3 id="cargo_init_common_options">Common Options</h3>
188188
<div class="dlist">
189189
<dl>
190+
<dt class="hdlist1"><strong>+TOOLCHAIN</strong></dt>
191+
<dd>
192+
<p>If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
193+
begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
194+
as <code>+stable</code> or <code>+nightly</code>).
195+
See the <a href="https://github.com/rust-lang/rustup/">rustup documentation</a>
196+
for more information about how toolchain overrides work.</p>
197+
</dd>
190198
<dt class="hdlist1"><strong>-h</strong></dt>
191199
<dt class="hdlist1"><strong>--help</strong></dt>
192200
<dd>

0 commit comments

Comments
 (0)