Open epage opened 2 years ago
Comment by epage Saturday Oct 16, 2021 at 00:58 GMT
I recommend we defer this out of 3.0.
I put this in the 3.0 milestone because it is a regression. I'm assuming fixing this will not be a breaking change and this is a corner of a corner case, so I think its fine for the initial release. My only concern is what other issues might be lingering from the same root cause.
Comment by pksunkara Saturday Oct 16, 2021 at 01:16 GMT
This might be because we manipulate help and version global args when starting up. But this subcommand gets added during parsing (which I don't think is good code). If we can move the subcommand adding to before, that should fix it.
Issue by epage Saturday Oct 16, 2021 at 00:57 GMT Originally opened as https://github.com/clap-rs/clap/issues/2892
Please complete the following tasks
Rust Version
rustc 1.55.0 (c8dfcfe04 2021-09-06)
Clap Version
master
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run -- help help
Actual Behaviour
Expected Behaviour
or for being able to run
cargo run -- help -c
but that producesbecause we are operating on raw data without the parser having pulled out
-c
or-h
, so we look those up as if they were subcommands which failsAdditional Context
This used to be worse but #2887 made some progress towards this.
This seems to be a regression compared to clap2
Debug Output
No response