Replies: 2 comments 2 replies
-
I just spent ~10 minutes reading the code, which was enlightening. As a
I now see that the answer to (1) is “you can call any method on And it looks like the answer to (2) is “first paragraph for short But now I’m also a bit more convinced that there’s not currently an easy Mentioning these in case you find the early adopter feedback helpful, |
Beta Was this translation helpful? Give feedback.
-
You can do |
Beta Was this translation helpful? Give feedback.
-
My application uses
#[derive(Clap)]
(at 3.0.0-beta.2) and includes adocstring with both short help text and long help text for each item.
For example:
The goal is to ensure that the help for each item shows up as a single
line when run with
-h
, and provides more detailed information when runwith
--help
. The-h
view works great:But with
--help
, both the short help and the long help are shown:This causes an extra paragraph on each item, duplicates the information,
and makes it grammatically inconsistent (the short helps are fragments,
whereas the long helps are sentences/paragraphs).
It would be great if
--help
could show just the long help:Might we change the derive-macro syntax to strip the first paragraph
from long help when more than one paragraph is given? Or, other
suggestions to solve this problem would also be appreciated.
Alternatives: maybe an option to
#[clap]
, in case people want theexisting behavior? maybe some way to combine the texts, by adding a full
stop if none exists and joining the first paragraph break? (sounds
confusing, though)
Make sure you completed the following tasks
Beta Was this translation helpful? Give feedback.
All reactions