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

Allow #[flatten] fields to have doc comments but ignore them (comments) #414

Merged
merged 2 commits into from Jul 25, 2020

Conversation

CreepySkeleton
Copy link
Collaborator

Closes #411

@@ -1,4 +1,4 @@
error: methods and doc comments are not allowed for flattened entry
error: methods are not allowed for flattened entry
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't the goal to ignore the doc comment? Here, the compilation fail.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is to ignore the comments, but disallow methods with flatten, like short. This is exactly what triggers it here.

/// Comments allowed
#[structopt(flatten)]

// Methods disallowed
#[structopt(flatten, short)]

Copy link
Owner

@TeXitoi TeXitoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, by bad, bad reading between test and error messages test.

@CreepySkeleton CreepySkeleton merged commit 2d8ba48 into master Jul 25, 2020
@CreepySkeleton CreepySkeleton deleted the flatten_doc_comment branch July 25, 2020 20:39
epage added a commit to epage/clap that referenced this pull request Oct 6, 2021
TeXitoi/structopt#414 was ported in
a951958 but the test was less exhaustive.  This updates our test to
match structopt's latest version of the test.

This is a part of clap-rs#2809
epage added a commit to epage/clap that referenced this pull request Oct 7, 2021
TeXitoi/structopt#414 was ported in
a951958 but the test was less exhaustive.  This updates our test to
match structopt's latest version of the test.

This is a part of clap-rs#2809
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.

Documenting flattened fields?
2 participants