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
use structopt::StructOpt;/// Doc comment.////// Multi-line.#[derive(StructOpt)]#[structopt(about = "Raw method.")]pubstructOptions{}fnmain(){Options::from_args();}
Steps to Reproduce
Untar the test case, cd into it, and run
$ cargo run -- --help
Expected Results
The about text should be
Raw method.
Actual Results
The about text reads
Doc comment.
Multi-line.
Misc.
If the doc comment is trimmed to a single line, e.g. just /// Doc comment., then the raw about method takes priority again.
Tested with structopt version 0.3.25.
The text was updated successfully, but these errors were encountered:
fitzgen
changed the title
Multi-line doc comments overrriding raw about attributes
Multi-line doc comments overriding raw about attributes
Nov 30, 2021
Looked a little closer. This is similar to clap-rs/clap#2983 in that you are overriding about but not overriding long_about while your doc comment is setting both. You'll see this dual nature by passing -h instead of --help.
The way to resolve this is to also set long_about.
Summary
The section for help/about text in the crate-level docs say
but that behavior is not exhibited when the doc comment has multiple lines.
Test Case
.tar.gz
bundle with full source,Cargo.toml
, andCargo.lock
Steps to Reproduce
Untar the test case,
cd
into it, and runExpected Results
The about text should be
Actual Results
The about text reads
Misc.
If the doc comment is trimmed to a single line, e.g. just
/// Doc comment.
, then the raw about method takes priority again.Tested with
structopt
version0.3.25
.The text was updated successfully, but these errors were encountered: