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

Subcommand about text is incorrectly wrapped #5607

Closed
2 tasks done
noc7c9 opened this issue Jul 30, 2024 · 0 comments · Fixed by #5615
Closed
2 tasks done

Subcommand about text is incorrectly wrapped #5607

noc7c9 opened this issue Jul 30, 2024 · 0 comments · Fixed by #5615
Labels
C-bug Category: Updating dependencies

Comments

@noc7c9
Copy link

noc7c9 commented Jul 30, 2024

Please complete the following tasks

Rust Version

rustc 1.80.0 (051478957 2024-07-21)

Clap Version

4.5.11

Minimal reproducible code

use clap::{Parser, Subcommand};

#[derive(Debug, Parser)]
struct Args {
    #[clap(subcommand)]
    sub: Command,
}

#[derive(Debug, Subcommand)]
enum Command {
    /// About text for subcommand that's just a little bit too long and so needs to be wrapped
    CmdName,
}

fn main() {
    Args::parse();
}

Steps to reproduce the bug with the above code

cargo run -- -h on a narrow enough terminal (examples below are 60 cols).

Actual Behaviour

Commands:
  cmd-name  About text for subcommand that's just a
                little bit too long and so needs to be
                wrapped
  help      Print this message or the help of the given
                subcommand(s)

Expected Behaviour

Commands:
  cmd-name  About text for subcommand that's just a
            little bit too long and so needs to be
            wrapped
  help      Print this message or the help of the given
            subcommand(s)

Additional Context

It works fine when you have a longer subcommand name.

Commands:
  a-much-longer-cmd-name
          About text for subcommand that's just a little bit
          too long and so needs to be wrapped
  help
          Print this message or the help of the given
          subcommand(s)

Debug Output

No response

@noc7c9 noc7c9 added the C-bug Category: Updating dependencies label Jul 30, 2024
@noc7c9 noc7c9 changed the title Command about text is incorrectly wrapped Subcommand about text is incorrectly wrapped Jul 30, 2024
epage added a commit to epage/clap that referenced this issue Jul 31, 2024
epage added a commit to epage/clap that referenced this issue Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Updating dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant