Skip to content

Commit 0e07a15

Browse files
authored
docs: remove stray directory metavar from cargo update --breaking option (#17319)
### What does this PR try to resolve? The `--breaking` option in `cargo update` is documented as taking a `directory` argument: --breaking directory Update spec to latest SemVer-breaking version. This is incorrect — `--breaking` is a plain boolean flag with no argument. It's defined via the `flag(...)` helper in `src/bin/cargo/commands/update.rs` and checked with `args.flag("breaking")`, the same pattern used by `--recursive`/`--dry-run`, which correctly show no metavar. Running `cargo update --help` confirms this: -b, --breaking Update [SPEC] to latest SemVer-breaking version (unstable) The stray `_directory_` appears to be a copy-paste artifact from other flags that legitimately take a directory value (e.g. `--artifact-dir`, `--target-dir`), most likely introduced when `--breaking` was added in #13979. This PR removes the incorrect metavar from the doc/man source (`doc/man/cargo-update.md`) and regenerates the derived outputs (`doc/man/generated_txt/cargo-update.txt`, `etc/man/cargo-update.1`, `doc/book/src/commands/cargo-update.md`) via `cargo build-man`, per the [documentation contributor guide](https://rust-lang.github.io/cargo/contrib/documentation/index.html#building-the-man-pages). ### How to test and review this PR? Compare the rendered `--breaking` entry before/after in `doc/man/generated_txt/cargo-update.txt` or `doc/book/src/commands/cargo-update.md` — it should no longer show `directory` after `--breaking`. This is a docs-only change; no behavior is affected. Fixes #17318
2 parents 7759f8c + d2960f8 commit 0e07a15

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

doc/book/src/commands/cargo-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ requirement in <code>Cargo.toml</code> doesn’t contain any pre-release identif
5050
</dd>
5151

5252

53-
<dt class="option-term" id="option-cargo-update---breaking"><a class="option-anchor" href="#option-cargo-update---breaking"><code>--breaking</code> <em>directory</em></a></dt>
53+
<dt class="option-term" id="option-cargo-update---breaking"><a class="option-anchor" href="#option-cargo-update---breaking"><code>--breaking</code></a></dt>
5454
<dd class="option-desc"><p>Update <em>spec</em> to highest SemVer-breaking version.</p>
5555
<p>Version requirements will be modified to allow this update.</p>
5656
<p>This only applies to dependencies when</p>

doc/man/cargo-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ A compatible `pre-release` version can also be specified even when the version
5151
requirement in `Cargo.toml` doesn't contain any pre-release identifier (nightly only).
5252
{{/option}}
5353

54-
{{#option "`--breaking` _directory_" }}
54+
{{#option "`--breaking`" }}
5555
Update _spec_ to highest SemVer-breaking version.
5656

5757
Version requirements will be modified to allow this update.

doc/man/generated_txt/cargo-update.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ OPTIONS
4343
version requirement in Cargo.toml doesn’t contain any pre-release
4444
identifier (nightly only).
4545

46-
--breaking directory
46+
--breaking
4747
Update spec to highest SemVer-breaking version.
4848

4949
Version requirements will be modified to allow this update.

etc/man/cargo-update.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ A compatible \fBpre\-release\fR version can also be specified even when the vers
4848
requirement in \fBCargo.toml\fR doesn\[cq]t contain any pre\-release identifier (nightly only).
4949
.RE
5050
.sp
51-
\fB\-\-breaking\fR \fIdirectory\fR
51+
\fB\-\-breaking\fR
5252
.RS 4
5353
Update \fIspec\fR to highest SemVer\-breaking version.
5454
.sp

0 commit comments

Comments
 (0)