-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
wrap_help can fail to wrap at the correct point #5022
Labels
C-bug
Category: Updating dependencies
Comments
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Jul 19, 2023
Although see clap-rs/clap#5022
For a full reproduction case: #!/usr/bin/env nargo
/*!
```cargo
[dependencies]
clap = { version = "4", features = ["derive", "wrap_help"] }
```
*/
use clap::{Parser, ValueEnum};
#[derive(Debug, Parser)]
struct Cli {
#[arg(short)]
foo: Foo,
}
#[derive(Clone, Debug, ValueEnum)]
enum Foo {
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
/// ut labore et dolore magna aliqua. Sed vulputate mi sit amet mauris commodo quis imperdiet
/// massa.
Foo,
}
fn main() {
let cli = Cli::parse();
println!("{cli:?}");
} ( |
epage
added a commit
to epage/clap
that referenced
this issue
Jul 19, 2023
We weren't taking the name into account when determining the wrap width. Fixes clap-rs#5022
epage
added a commit
to epage/clap
that referenced
this issue
Jul 19, 2023
We weren't taking the name into account when determining the wrap width. Fixes clap-rs#5022
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 14, 2023
* Add env feature to clap and cargo update * Dead Code: WIP CLI changes * Dead Code: CLI feature parity Although see clap-rs/clap#5020 * Note about not (yet) using infer_subcommands See clap-rs/clap#5021 * Use clap/wrap_help Although see clap-rs/clap#5022 * WIP: Strip out previous CLI argument parser setup [skip ci] * WIP: Normalise arguments for caller [skip ci] * Don't check for file-ness in the CLI argument parser * File and directory canonicalisation for the argument parser * Expose CLI types so they can be used downstream
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 14, 2023
* Add env feature to clap and cargo update * Dead Code: WIP CLI changes * Dead Code: CLI feature parity Although see clap-rs/clap#5020 * Note about not (yet) using infer_subcommands See clap-rs/clap#5021 * Use clap/wrap_help Although see clap-rs/clap#5022 * WIP: Strip out previous CLI argument parser setup [skip ci] * WIP: Normalise arguments for caller [skip ci] * Don't check for file-ness in the CLI argument parser * File and directory canonicalisation for the argument parser * Expose CLI types so they can be used downstream
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 17, 2023
Note that clap doesn't support (--foo [--bar] | --quux) groups very cleanly; it was a bit of a hack to get this to work, with the result being the error text being a bit off when an illegal combination is attempted. I've attempted to compensate for this by making the long help text quite explicit. Also updated clap, which contains the fix for clap-rs/clap#5022
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 18, 2023
* Note about not using infer_subcommands * --tolerate-parsing-errors doesn't make sense for visualisation * Separate out input source types so we can create a unified interface * Fallback to the given output path if canonicalisation fails Resolves #588 * We're going to need an InputFile, too * WIP: InputFile type * Correct blunder regarding --query Note that clap doesn't support (--foo [--bar] | --quux) groups very cleanly; it was a bit of a hack to get this to work, with the result being the error text being a bit off when an illegal combination is attempted. I've attempted to compensate for this by making the long help text quite explicit. Also updated clap, which contains the fix for clap-rs/clap#5022 * Missed change to README * Add note RE clap-rs/clap#4707 workaround * Machinery to unify inputs + downstream use to reimplement visualisation * Don't flatten-away errors * Don't open the input file until we need to read from it * Into InputFrom should be from &AtLeastOneInput * Add logging * Moar logging!1!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please complete the following tasks
Rust Version
rustc 1.70.0 (90c541806 2023-05-31) (built from a source tarball)
Clap Version
4.3.16
Minimal reproducible code
Steps to reproduce the bug with the above code
Set your terminal to 90 columns, for example, then:
Actual Behaviour
Output (manually hard-wrapped for sake of demonstration):
Expected Behaviour
Output:
Additional Context
Tested in Zsh 5.8.1 and Bash 5.1.16, both running inside and outside Tmux 3.2a.
Debug Output
The text was updated successfully, but these errors were encountered: