You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In clap, multiline help messages and one-big-line messages are different.
Multiline messages are displayed "as is", all the line breaks are to be preserved and clap will make no attempt to wrap such a message to the terminal's width.
One line messages are to be wrapped to the terminal's width.
structopt's doc comments implement the one line case by default because most people don't really care about precise formatting when they write a doc comment and they do want their help to be wrapped (or we just think so).
The multiline use case is not possible toady with doc comments, but fear not! This is already in development in #296 which is about to be merged and released. From this moment on all you'll need to do would be adding #[structopt(verbatim_doc_comment)] attribute and structopt won't touch line breaks.
The fix for #25 joined multiline doc comments with a space.
However,
clap
supports newlines in help text and properly aligns it.For the original example:
This outputs:
If instead the lines join with
\n
instead of space, clap would output:The text was updated successfully, but these errors were encountered: