Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mangen): Avoid spurious value names for derive args without values #4645

Merged
merged 1 commit into from Feb 22, 2023
Merged

fix(mangen): Avoid spurious value names for derive args without values #4645

merged 1 commit into from Feb 22, 2023

Conversation

bgilbert
Copy link
Contributor

derive arguments like this:

#[arg(long)]
pub flag: bool,

were producing option descriptions like this:

--flag=FLAG

FLAG is spurious. It turns out that derive always sets a value name, for simplicity, even when there are no arguments. Check for this case.

Fixes #4443.

@bgilbert bgilbert changed the title fix(mangen): avoid spurious value names for derive args without values fix(mangen): Avoid spurious value names for derive args without values Jan 16, 2023
clap_mangen/src/render.rs Outdated Show resolved Hide resolved
clap_mangen/tests/roff.rs Outdated Show resolved Hide resolved
derive arguments like this:

    #[arg(long)]
    pub flag: bool,

were producing option descriptions like this:

    --flag=FLAG

FLAG is spurious.  It turns out that derive always sets a value name, for
simplicity, even when there are no arguments.  Check for this case.

Fixes #4443.
@bgilbert
Copy link
Contributor Author

Updated for review comments.

@bgilbert
Copy link
Contributor Author

@epage Could you take another look? This is the last blocker for migrating a project I maintain off of clap 3.

@epage
Copy link
Member

epage commented Feb 22, 2023

Thanks for the ping!

@epage epage merged commit 776f12e into clap-rs:master Feb 22, 2023
@epage
Copy link
Member

epage commented Feb 22, 2023

Released

@bgilbert bgilbert deleted the mangen-flag branch February 22, 2023 23:18
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.

Generated man pages still claim that flag options take values
3 participants