-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
A-deriveArea: #[derive]` macro APIArea: #[derive]` macro APIC-bugCategory: bugCategory: bugE-hardCall for participation: Experience needed to fix: Hard / a lotCall for participation: Experience needed to fix: Hard / a lot
Description
Please complete the following tasks
- I have searched the discussions
- I have searched the existing issues
Rust Version
1.54.0
Clap Version
master
Minimal reproducible code
#[test]
fn doc_comments_raw_macro() {
macro_rules! doc_lorem_ipsum {
() => {
"Lorem ipsum"
};
(inner) => {
"Fooify a bar and a baz"
};
}
#[doc = doc_lorem_ipsum!()]
#[derive(Clap, PartialEq, Debug)]
struct LoremIpsum {
#[doc = doc_lorem_ipsum!(inner)]
#[clap(short, long)]
foo: bool,
}
let help = get_long_help::<LoremIpsum>();
assert!(help.contains("Lorem ipsum"));
assert!(help.contains("Fooify a bar and a baz"));
}
Steps to reproduce the bug with the above code
Run the test above.
Actual Behaviour
Assertions fail with no comments help message detected:
%%% LONG_HELP %%%:=====
clap_derive
USAGE:
clap_derive [FLAGS]
FLAGS:
-f, --foo
-h, --help
Prints help information
-V, --version
Prints version information
=====
Expected Behaviour
Assertions pass with all help messages specified by the macro call.
%%% LONG_HELP %%%:=====
clap_derive
<- We should see some help messages here...
USAGE:
clap_derive [FLAGS]
FLAGS:
-f, --foo <- And here...
-h, --help
Prints help information
-V, --version
Prints version information
=====
Additional Context
No response
Debug Output
No response
5-pebbles and stevenengler
Metadata
Metadata
Assignees
Labels
A-deriveArea: #[derive]` macro APIArea: #[derive]` macro APIC-bugCategory: bugCategory: bugE-hardCall for participation: Experience needed to fix: Hard / a lotCall for participation: Experience needed to fix: Hard / a lot