Skip to content

fix(mangen): Hide hidden positionals from the SYNOPSIS - #6482

Merged
epage merged 2 commits into
clap-rs:masterfrom
codeAnqiang-ma:fix/mangen-hidden-positional-synopsis
Aug 12, 2026
Merged

epage merged 2 commits into
clap-rs:masterfrom
codeAnqiang-ma:fix/mangen-hidden-positional-synopsis

Conversation

@codeAnqiang-ma

Copy link
Copy Markdown
Contributor

What does this PR try to solve?

Fixes #6481

clap_mangen's SYNOPSIS rendered positional arguments marked with Arg::hide(true), while

So a man page could advertise a positional in the SYNOPSIS that is documented nowhere else on the page. This applies the same is_hide_set() filter to the positionals loop in synopsis().

Notes to reviewers

  • Follows the "test commit first, then fix commit" convention: the first commit snapshots the current behavior ([secret] present in SYNOPSIS), the second commit's snapshot diff shows exactly what changed.

  • Test evidence (cargo test -p clap_mangen):

    $ cargo test -p clap_mangen
    test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
    test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

    Regenerating all snapshots with SNAPSHOTS=overwrite only changed hidden_positional.bash.roff, so no other rendering scenario is affected. Other workspace crates were not run.

  • This PR was prepared with AI assistance; I reproduced the issue locally and reviewed every change.

codeAnqiang-ma and others added 2 commits August 13, 2026 01:32
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@codeAnqiang-ma
codeAnqiang-ma force-pushed the fix/mangen-hidden-positional-synopsis branch from 648efc3 to 07c6fd2 Compare August 12, 2026 18:32
@epage
epage merged commit 6689200 into clap-rs:master Aug 12, 2026
49 of 50 checks passed
@epage

epage commented Aug 12, 2026

Copy link
Copy Markdown
Member

As a warning,

  • Our contrib guide and our template explicitly say you need an issue first
  • We don't care what test evidence you have that is reproduced by CI. The PR template was setup to specifically avoid noise like that from being introduced.

santoshkumarradha pushed a commit to Agent-Field/CodeAF that referenced this pull request Oct 24, 2026
…#6482)

Test-first two-commit PR: the hidden_positionals snapshot test lands at the
first commit, the one-line filter in clap_mangen/src/render.rs at the second.
Base 8e50ec8 (parent of the first commit), reference 07c6fd2 (the PR head);
the reference patch spans the whole PR so it applies to the base, whose
snapshot the fix commit edits. Pinned stable Rust 1.85.0 (the tree's MSRV)
in the environment image. Controls: gold 1.00, negative 0.0 with both
blockers failed.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clap_mangen: SYNOPSIS shows positional arguments marked with Arg::hide(true)

2 participants