Skip to content

Commit 34cb1ea

Browse files
committed
Auto merge of #11947 - ehuss:c-before-command, r=weihanglo
Clarify docs on `-C` that it appears before the command. The docs for `-C` currently don't mention that it must appear before the command name. This is the only root option that behaves this way that is documented in every page (except for `+toolchain`, which already mentions its position restriction). This adds some text to explain this restriction.
2 parents 1b2de21 + 9ba2ca2 commit 34cb1ea

File tree

97 files changed

+226
-97
lines changed

Some content is hidden

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

97 files changed

+226
-97
lines changed

src/doc/man/generated_txt/cargo-add.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ OPTIONS
191191
Changes the current working directory before executing any specified
192192
operations. This affects things like where cargo looks by default
193193
for the project manifest (Cargo.toml), as well as the directories
194-
searched for discovering .cargo/config.toml, for example.
194+
searched for discovering .cargo/config.toml, for example. This
195+
option must appear before the command name, for example cargo -C
196+
path/to/my-project build.
195197

196198
-h, --help
197199
Prints help information.

src/doc/man/generated_txt/cargo-bench.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ OPTIONS
376376
Changes the current working directory before executing any specified
377377
operations. This affects things like where cargo looks by default
378378
for the project manifest (Cargo.toml), as well as the directories
379-
searched for discovering .cargo/config.toml, for example.
379+
searched for discovering .cargo/config.toml, for example. This
380+
option must appear before the command name, for example cargo -C
381+
path/to/my-project build.
380382

381383
-h, --help
382384
Prints help information.

src/doc/man/generated_txt/cargo-build.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ OPTIONS
318318
Changes the current working directory before executing any specified
319319
operations. This affects things like where cargo looks by default
320320
for the project manifest (Cargo.toml), as well as the directories
321-
searched for discovering .cargo/config.toml, for example.
321+
searched for discovering .cargo/config.toml, for example. This
322+
option must appear before the command name, for example cargo -C
323+
path/to/my-project build.
322324

323325
-h, --help
324326
Prints help information.

src/doc/man/generated_txt/cargo-check.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ OPTIONS
303303
Changes the current working directory before executing any specified
304304
operations. This affects things like where cargo looks by default
305305
for the project manifest (Cargo.toml), as well as the directories
306-
searched for discovering .cargo/config.toml, for example.
306+
searched for discovering .cargo/config.toml, for example. This
307+
option must appear before the command name, for example cargo -C
308+
path/to/my-project build.
307309

308310
-h, --help
309311
Prints help information.

src/doc/man/generated_txt/cargo-clean.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ OPTIONS
132132
Changes the current working directory before executing any specified
133133
operations. This affects things like where cargo looks by default
134134
for the project manifest (Cargo.toml), as well as the directories
135-
searched for discovering .cargo/config.toml, for example.
135+
searched for discovering .cargo/config.toml, for example. This
136+
option must appear before the command name, for example cargo -C
137+
path/to/my-project build.
136138

137139
-h, --help
138140
Prints help information.

src/doc/man/generated_txt/cargo-doc.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ OPTIONS
274274
Changes the current working directory before executing any specified
275275
operations. This affects things like where cargo looks by default
276276
for the project manifest (Cargo.toml), as well as the directories
277-
searched for discovering .cargo/config.toml, for example.
277+
searched for discovering .cargo/config.toml, for example. This
278+
option must appear before the command name, for example cargo -C
279+
path/to/my-project build.
278280

279281
-h, --help
280282
Prints help information.

src/doc/man/generated_txt/cargo-fetch.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ OPTIONS
117117
Changes the current working directory before executing any specified
118118
operations. This affects things like where cargo looks by default
119119
for the project manifest (Cargo.toml), as well as the directories
120-
searched for discovering .cargo/config.toml, for example.
120+
searched for discovering .cargo/config.toml, for example. This
121+
option must appear before the command name, for example cargo -C
122+
path/to/my-project build.
121123

122124
-h, --help
123125
Prints help information.

src/doc/man/generated_txt/cargo-fix.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ OPTIONS
376376
Changes the current working directory before executing any specified
377377
operations. This affects things like where cargo looks by default
378378
for the project manifest (Cargo.toml), as well as the directories
379-
searched for discovering .cargo/config.toml, for example.
379+
searched for discovering .cargo/config.toml, for example. This
380+
option must appear before the command name, for example cargo -C
381+
path/to/my-project build.
380382

381383
-h, --help
382384
Prints help information.

src/doc/man/generated_txt/cargo-generate-lockfile.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ OPTIONS
9292
Changes the current working directory before executing any specified
9393
operations. This affects things like where cargo looks by default
9494
for the project manifest (Cargo.toml), as well as the directories
95-
searched for discovering .cargo/config.toml, for example.
95+
searched for discovering .cargo/config.toml, for example. This
96+
option must appear before the command name, for example cargo -C
97+
path/to/my-project build.
9698

9799
-h, --help
98100
Prints help information.

src/doc/man/generated_txt/cargo-init.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ OPTIONS
100100
Changes the current working directory before executing any specified
101101
operations. This affects things like where cargo looks by default
102102
for the project manifest (Cargo.toml), as well as the directories
103-
searched for discovering .cargo/config.toml, for example.
103+
searched for discovering .cargo/config.toml, for example. This
104+
option must appear before the command name, for example cargo -C
105+
path/to/my-project build.
104106

105107
-h, --help
106108
Prints help information.

src/doc/man/generated_txt/cargo-install.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ OPTIONS
355355
Changes the current working directory before executing any specified
356356
operations. This affects things like where cargo looks by default
357357
for the project manifest (Cargo.toml), as well as the directories
358-
searched for discovering .cargo/config.toml, for example.
358+
searched for discovering .cargo/config.toml, for example. This
359+
option must appear before the command name, for example cargo -C
360+
path/to/my-project build.
359361

360362
-h, --help
361363
Prints help information.

src/doc/man/generated_txt/cargo-locate-project.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ OPTIONS
8383
Changes the current working directory before executing any specified
8484
operations. This affects things like where cargo looks by default
8585
for the project manifest (Cargo.toml), as well as the directories
86-
searched for discovering .cargo/config.toml, for example.
86+
searched for discovering .cargo/config.toml, for example. This
87+
option must appear before the command name, for example cargo -C
88+
path/to/my-project build.
8789

8890
-h, --help
8991
Prints help information.

src/doc/man/generated_txt/cargo-login.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ OPTIONS
7575
Changes the current working directory before executing any specified
7676
operations. This affects things like where cargo looks by default
7777
for the project manifest (Cargo.toml), as well as the directories
78-
searched for discovering .cargo/config.toml, for example.
78+
searched for discovering .cargo/config.toml, for example. This
79+
option must appear before the command name, for example cargo -C
80+
path/to/my-project build.
7981

8082
-h, --help
8183
Prints help information.

src/doc/man/generated_txt/cargo-metadata.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,9 @@ OPTIONS
405405
Changes the current working directory before executing any specified
406406
operations. This affects things like where cargo looks by default
407407
for the project manifest (Cargo.toml), as well as the directories
408-
searched for discovering .cargo/config.toml, for example.
408+
searched for discovering .cargo/config.toml, for example. This
409+
option must appear before the command name, for example cargo -C
410+
path/to/my-project build.
409411

410412
-h, --help
411413
Prints help information.

src/doc/man/generated_txt/cargo-new.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ OPTIONS
9595
Changes the current working directory before executing any specified
9696
operations. This affects things like where cargo looks by default
9797
for the project manifest (Cargo.toml), as well as the directories
98-
searched for discovering .cargo/config.toml, for example.
98+
searched for discovering .cargo/config.toml, for example. This
99+
option must appear before the command name, for example cargo -C
100+
path/to/my-project build.
99101

100102
-h, --help
101103
Prints help information.

src/doc/man/generated_txt/cargo-owner.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ OPTIONS
102102
Changes the current working directory before executing any specified
103103
operations. This affects things like where cargo looks by default
104104
for the project manifest (Cargo.toml), as well as the directories
105-
searched for discovering .cargo/config.toml, for example.
105+
searched for discovering .cargo/config.toml, for example. This
106+
option must appear before the command name, for example cargo -C
107+
path/to/my-project build.
106108

107109
-h, --help
108110
Prints help information.

src/doc/man/generated_txt/cargo-package.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ OPTIONS
244244
Changes the current working directory before executing any specified
245245
operations. This affects things like where cargo looks by default
246246
for the project manifest (Cargo.toml), as well as the directories
247-
searched for discovering .cargo/config.toml, for example.
247+
searched for discovering .cargo/config.toml, for example. This
248+
option must appear before the command name, for example cargo -C
249+
path/to/my-project build.
248250

249251
-h, --help
250252
Prints help information.

src/doc/man/generated_txt/cargo-pkgid.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ OPTIONS
122122
Changes the current working directory before executing any specified
123123
operations. This affects things like where cargo looks by default
124124
for the project manifest (Cargo.toml), as well as the directories
125-
searched for discovering .cargo/config.toml, for example.
125+
searched for discovering .cargo/config.toml, for example. This
126+
option must appear before the command name, for example cargo -C
127+
path/to/my-project build.
126128

127129
-h, --help
128130
Prints help information.

src/doc/man/generated_txt/cargo-publish.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ OPTIONS
210210
Changes the current working directory before executing any specified
211211
operations. This affects things like where cargo looks by default
212212
for the project manifest (Cargo.toml), as well as the directories
213-
searched for discovering .cargo/config.toml, for example.
213+
searched for discovering .cargo/config.toml, for example. This
214+
option must appear before the command name, for example cargo -C
215+
path/to/my-project build.
214216

215217
-h, --help
216218
Prints help information.

src/doc/man/generated_txt/cargo-remove.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ OPTIONS
111111
Changes the current working directory before executing any specified
112112
operations. This affects things like where cargo looks by default
113113
for the project manifest (Cargo.toml), as well as the directories
114-
searched for discovering .cargo/config.toml, for example.
114+
searched for discovering .cargo/config.toml, for example. This
115+
option must appear before the command name, for example cargo -C
116+
path/to/my-project build.
115117

116118
-h, --help
117119
Prints help information.

src/doc/man/generated_txt/cargo-run.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ OPTIONS
222222
Changes the current working directory before executing any specified
223223
operations. This affects things like where cargo looks by default
224224
for the project manifest (Cargo.toml), as well as the directories
225-
searched for discovering .cargo/config.toml, for example.
225+
searched for discovering .cargo/config.toml, for example. This
226+
option must appear before the command name, for example cargo -C
227+
path/to/my-project build.
226228

227229
-h, --help
228230
Prints help information.

src/doc/man/generated_txt/cargo-rustc.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ OPTIONS
320320
Changes the current working directory before executing any specified
321321
operations. This affects things like where cargo looks by default
322322
for the project manifest (Cargo.toml), as well as the directories
323-
searched for discovering .cargo/config.toml, for example.
323+
searched for discovering .cargo/config.toml, for example. This
324+
option must appear before the command name, for example cargo -C
325+
path/to/my-project build.
324326

325327
-h, --help
326328
Prints help information.

src/doc/man/generated_txt/cargo-rustdoc.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ OPTIONS
290290
Changes the current working directory before executing any specified
291291
operations. This affects things like where cargo looks by default
292292
for the project manifest (Cargo.toml), as well as the directories
293-
searched for discovering .cargo/config.toml, for example.
293+
searched for discovering .cargo/config.toml, for example. This
294+
option must appear before the command name, for example cargo -C
295+
path/to/my-project build.
294296

295297
-h, --help
296298
Prints help information.

src/doc/man/generated_txt/cargo-search.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ OPTIONS
7272
Changes the current working directory before executing any specified
7373
operations. This affects things like where cargo looks by default
7474
for the project manifest (Cargo.toml), as well as the directories
75-
searched for discovering .cargo/config.toml, for example.
75+
searched for discovering .cargo/config.toml, for example. This
76+
option must appear before the command name, for example cargo -C
77+
path/to/my-project build.
7678

7779
-h, --help
7880
Prints help information.

src/doc/man/generated_txt/cargo-test.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ OPTIONS
394394
Changes the current working directory before executing any specified
395395
operations. This affects things like where cargo looks by default
396396
for the project manifest (Cargo.toml), as well as the directories
397-
searched for discovering .cargo/config.toml, for example.
397+
searched for discovering .cargo/config.toml, for example. This
398+
option must appear before the command name, for example cargo -C
399+
path/to/my-project build.
398400

399401
-h, --help
400402
Prints help information.

src/doc/man/generated_txt/cargo-tree.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ OPTIONS
303303
Changes the current working directory before executing any specified
304304
operations. This affects things like where cargo looks by default
305305
for the project manifest (Cargo.toml), as well as the directories
306-
searched for discovering .cargo/config.toml, for example.
306+
searched for discovering .cargo/config.toml, for example. This
307+
option must appear before the command name, for example cargo -C
308+
path/to/my-project build.
307309

308310
-h, --help
309311
Prints help information.

src/doc/man/generated_txt/cargo-uninstall.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ OPTIONS
8484
Changes the current working directory before executing any specified
8585
operations. This affects things like where cargo looks by default
8686
for the project manifest (Cargo.toml), as well as the directories
87-
searched for discovering .cargo/config.toml, for example.
87+
searched for discovering .cargo/config.toml, for example. This
88+
option must appear before the command name, for example cargo -C
89+
path/to/my-project build.
8890

8991
-h, --help
9092
Prints help information.

src/doc/man/generated_txt/cargo-update.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ OPTIONS
122122
Changes the current working directory before executing any specified
123123
operations. This affects things like where cargo looks by default
124124
for the project manifest (Cargo.toml), as well as the directories
125-
searched for discovering .cargo/config.toml, for example.
125+
searched for discovering .cargo/config.toml, for example. This
126+
option must appear before the command name, for example cargo -C
127+
path/to/my-project build.
126128

127129
-h, --help
128130
Prints help information.

src/doc/man/generated_txt/cargo-vendor.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ OPTIONS
118118
Changes the current working directory before executing any specified
119119
operations. This affects things like where cargo looks by default
120120
for the project manifest (Cargo.toml), as well as the directories
121-
searched for discovering .cargo/config.toml, for example.
121+
searched for discovering .cargo/config.toml, for example. This
122+
option must appear before the command name, for example cargo -C
123+
path/to/my-project build.
122124

123125
-h, --help
124126
Prints help information.

src/doc/man/generated_txt/cargo-verify-project.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ OPTIONS
9595
Changes the current working directory before executing any specified
9696
operations. This affects things like where cargo looks by default
9797
for the project manifest (Cargo.toml), as well as the directories
98-
searched for discovering .cargo/config.toml, for example.
98+
searched for discovering .cargo/config.toml, for example. This
99+
option must appear before the command name, for example cargo -C
100+
path/to/my-project build.
99101

100102
-h, --help
101103
Prints help information.

src/doc/man/generated_txt/cargo-yank.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ OPTIONS
9999
Changes the current working directory before executing any specified
100100
operations. This affects things like where cargo looks by default
101101
for the project manifest (Cargo.toml), as well as the directories
102-
searched for discovering .cargo/config.toml, for example.
102+
searched for discovering .cargo/config.toml, for example. This
103+
option must appear before the command name, for example cargo -C
104+
path/to/my-project build.
103105

104106
-h, --help
105107
Prints help information.

src/doc/man/generated_txt/cargo.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ OPTIONS
201201
Changes the current working directory before executing any specified
202202
operations. This affects things like where cargo looks by default
203203
for the project manifest (Cargo.toml), as well as the directories
204-
searched for discovering .cargo/config.toml, for example.
204+
searched for discovering .cargo/config.toml, for example. This
205+
option must appear before the command name, for example cargo -C
206+
path/to/my-project build.
205207

206208
-h, --help
207209
Prints help information.

src/doc/man/includes/section-options-common.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ See the [command-line overrides section](../reference/config.html#command-line-o
1919
{{#option "`-C` _PATH_"}}
2020
Changes the current working directory before executing any specified operations. This affects
2121
things like where cargo looks by default for the project manifest (`Cargo.toml`), as well as
22-
the directories searched for discovering `.cargo/config.toml`, for example.
22+
the directories searched for discovering `.cargo/config.toml`, for example. This option must
23+
appear before the command name, for example `cargo -C path/to/my-project build`.
2324
{{/option}}
2425

2526
{{#option "`-h`" "`--help`"}}

src/doc/src/commands/cargo-add.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ See the <a href="../reference/config.html#command-line-overrides">command-line o
225225
<dt class="option-term" id="option-cargo-add--C"><a class="option-anchor" href="#option-cargo-add--C"></a><code>-C</code> <em>PATH</em></dt>
226226
<dd class="option-desc">Changes the current working directory before executing any specified operations. This affects
227227
things like where cargo looks by default for the project manifest (<code>Cargo.toml</code>), as well as
228-
the directories searched for discovering <code>.cargo/config.toml</code>, for example.</dd>
228+
the directories searched for discovering <code>.cargo/config.toml</code>, for example. This option must
229+
appear before the command name, for example <code>cargo -C path/to/my-project build</code>.</dd>
229230

230231

231232
<dt class="option-term" id="option-cargo-add--h"><a class="option-anchor" href="#option-cargo-add--h"></a><code>-h</code></dt>

0 commit comments

Comments
 (0)