Hidden subcommands shown when "requires a subcommand but one was not provided" #5471
Open
2 tasks done
Labels
A-help
Area: documentation, including docs.rs, readme, examples, etc...
C-bug
Category: Updating dependencies
S-waiting-on-decision
Status: Waiting on a go/no-go before implementing
Please complete the following tasks
Rust Version
rustc 1.74.0 (79e9716c9 2023-11-13)
Clap Version
4.5.4
Minimal reproducible code
Steps to reproduce the bug with the above code
Actual Behaviour
The problem is that the
secret
subcommand is marked as hidden, yet it is suggested as one of the possible subcommands in the list[subcommands: hello, secret, help]
Expected Behaviour
Since the
secret
subcommand is marked as hidden, it should not be suggested to the user in the list of possible subcommands. SoActual:
[subcommands: hello, secret, help]
Expected:
[subcommands: hello, help]
Additional Context
The
--message
flag in the repro case seems to be important. If I remove it and omit the subcommand, it sees that no arguments are provided and simply displays the normal help message, which correctly omits the hidden subcommand.Debug Output
No response
The text was updated successfully, but these errors were encountered: