Skip to content

Doc: cargo update --breaking shows a stray directory argument in its option heading #17318

Description

@GuTS805

Problem

The doc source for cargo update --breaking in doc/man/cargo-update.md (line 54) defines the option heading as:

{{#option "`--breaking` _directory_" }}

This renders in both the published Cargo Book (https://doc.rust-lang.org/cargo/commands/cargo-update.html) and the generated man page (doc/man/generated_txt/cargo-update.txt) as:

--breaking directory
    Update spec to latest SemVer-breaking version.

This implies --breaking takes a directory value, but it's a plain boolean flag with no argument. Confirmed in src/bin/cargo/commands/update.rs, where --breaking is defined via the flag(...) helper (no value) and checked with args.flag("breaking"), the same pattern used by --recursive/--dry-run, which correctly show no metavar in the docs. Running cargo update --help also confirms no argument is expected:

-b, --breaking  Update [SPEC] to latest SemVer-breaking version (unstable)

The description text under the doc entry itself never mentions a directory either — it only discusses updating spec's SemVer requirement.

Likely cause: _directory_ is a legitimate metavar used correctly elsewhere for path-taking flags (e.g. --artifact-dir, --target-dir), and appears to have been copy-pasted into the --breaking entry by mistake, possibly when the flag was added in #13979.

Steps

  1. View the "Options" section for --breaking at https://doc.rust-lang.org/cargo/commands/cargo-update.html (or run cargo update --help/view the generated man page and compare)
  2. Note the doc heading reads --breaking directory
  3. Compare against cargo update --help output, which shows --breaking as a plain flag with no argument

Possible Solution(s)

Remove _directory_ from the option heading in doc/man/cargo-update.md line 54, changing:

{{#option "`--breaking` _directory_" }}

to:

{{#option "`--breaking`" }}

matching the style of sibling flags (--recursive, --dry-run, -w/--workspace) in the same file. Regenerate the derived docs (man page txt / book HTML) via the repo's existing doc-generation xtask so they stay in sync.

Notes

Not a duplicate of #12425 (tracking issue for the --breaking feature) or #14204/#14178 (behavioral complaints about how --breaking resolves prerelease versions). None of those address this doc rendering typo.

Version

cargo 1.92.0 (344c4567c 2025-10-21)
release: 1.92.0
commit-hash: 344c4567c634a25837e3c3476aac08af84cf9203
commit-date: 2025-10-21
host: x86_64-pc-windows-msvc
libgit2: 1.9.1 (sys:0.20.2 vendored)
libcurl: 8.15.0-DEV (sys:0.4.83+curl-8.15.0 vendored ssl:Schannel)
os: Windows 10.0.26200 (Windows 11 CoreSingleLanguage) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions