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

Paragraphs for long help derived from doc comments may be splitted on more cases #5802

Closed
2 tasks done
JohanVonElectrum opened this issue Nov 1, 2024 · 3 comments
Closed
2 tasks done
Labels
A-derive Area: #[derive]` macro API C-bug Category: Updating dependencies

Comments

@JohanVonElectrum
Copy link

Please complete the following tasks

Rust Version

rustc 1.80.0 (051478957 2024-07-21)

Clap Version

4.5.20

Minimal reproducible code

use clap::Parser;

#[derive(Debug, Parser)]
struct GlobalArgs {
    /// Verbose level
    ///
    /// Levels:  
    /// - 0: info + warn + error  
    /// - 1: debug + info + warn + error  
    /// - 2: trace + debug + info + warn + error
    #[arg(short, long, action = clap::ArgAction::Count)]
    verbose: u8,
}

#[derive(Debug, Parser)]
#[command(version, about, long_about = None)]
struct Args {
    #[clap(flatten)]
    global: GlobalArgs,
}

fn main() {
    let args = Args::parse();
    println!("{:?}", args);
}

Steps to reproduce the bug with the above code

cargo run -- --help

Actual Behaviour

Options:
-v, --verbose...
Verbose mode, print more information

      Levels: - 0: info + warn + error - 1: debug + info + warn + error - 2: trace + debug + info + warn + error

Expected Behaviour

Options:
-v, --verbose...
Verbose mode, print more information

      Levels:
      - 0: info + warn + error
      - 1: debug + info + warn + error
      - 2: trace + debug + info + warn + error

Additional Context

I expect a paragraph to split on lines ending on double space or backslash or when starting by - or <num>. . Note that in the provided minimal example the lines from Level: to - 1: ... end with double space.

Debug Output

No response

@JohanVonElectrum JohanVonElectrum added the C-bug Category: Updating dependencies label Nov 1, 2024
@epage epage self-assigned this Nov 4, 2024
@epage epage added the A-derive Area: #[derive]` macro API label Nov 4, 2024
@epage epage removed their assignment Nov 4, 2024
@epage
Copy link
Member

epage commented Nov 4, 2024

This appears to be a duplicate of #2389, closing in favor of that

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
@JohanVonElectrum
Copy link
Author

Thank you for pointing that out. I had searched for issues related to newlines but didn’t find #2389, as it addresses general markdown parsing. I now see the overlap and will contribute to the discussion there. Thanks for the guidance!

@epage
Copy link
Member

epage commented Nov 4, 2024

Fully understand the difficulty of finding issues and identifying whats relevant!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-derive Area: #[derive]` macro API C-bug Category: Updating dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants