Unclear error message: "Found non-required positional argument with a lower index than ..." #5260
Open
2 tasks done
Labels
C-bug
Category: Updating dependencies
Please complete the following tasks
Rust Version
1.74.1
Clap Version
4.4.11
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run
Actual Behaviour
thread 'main' panicked at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.11/src/builder/debug_asserts.rs:658:17:
Found non-required positional argument with a lower index than a required positional argument: "file" index Some(1)
note: run with
RUST_BACKTRACE=1
environment variable to display a backtraceExpected Behaviour
A better clearer error message.
Maybe something like:
Additional Context
This error message is very difficult to understand. And it is hard to know what exactly goes wrong and how to fix it.
Error message in clap code:
clap/clap_builder/src/builder/debug_asserts.rs
Lines 660 to 661 in d092896
And similar:
clap/clap_builder/src/builder/debug_asserts.rs
Lines 630 to 632 in d092896
Debug Output
The text was updated successfully, but these errors were encountered: