Skip to content

Commit

Permalink
Auto merge of #11947 - ehuss:c-before-command, r=weihanglo
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Apr 9, 2023
2 parents 1b2de21 + 9ba2ca2 commit 34cb1ea
Show file tree
Hide file tree
Showing 97 changed files with 226 additions and 97 deletions.
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-clean.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-fetch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-fix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-generate-lockfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-init.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-locate-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-login.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-owner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-package.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-pkgid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-publish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-remove.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-run.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-rustc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-rustdoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-uninstall.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-verify-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-yank.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ OPTIONS
Changes the current working directory before executing any specified
operations. This affects things like where cargo looks by default
for the project manifest (Cargo.toml), as well as the directories
searched for discovering .cargo/config.toml, for example.
searched for discovering .cargo/config.toml, for example. This
option must appear before the command name, for example cargo -C
path/to/my-project build.

-h, --help
Prints help information.
Expand Down
3 changes: 2 additions & 1 deletion src/doc/man/includes/section-options-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ See the [command-line overrides section](../reference/config.html#command-line-o
{{#option "`-C` _PATH_"}}
Changes the current working directory before executing any specified operations. This affects
things like where cargo looks by default for the project manifest (`Cargo.toml`), as well as
the directories searched for discovering `.cargo/config.toml`, for example.
the directories searched for discovering `.cargo/config.toml`, for example. This option must
appear before the command name, for example `cargo -C path/to/my-project build`.
{{/option}}

{{#option "`-h`" "`--help`"}}
Expand Down
3 changes: 2 additions & 1 deletion src/doc/src/commands/cargo-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ See the <a href="../reference/config.html#command-line-overrides">command-line o
<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>
<dd class="option-desc">Changes the current working directory before executing any specified operations. This affects
things like where cargo looks by default for the project manifest (<code>Cargo.toml</code>), as well as
the directories searched for discovering <code>.cargo/config.toml</code>, for example.</dd>
the directories searched for discovering <code>.cargo/config.toml</code>, for example. This option must
appear before the command name, for example <code>cargo -C path/to/my-project build</code>.</dd>


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

0 comments on commit 34cb1ea

Please sign in to comment.