Please provide an argument to make the derive automatically generate a test #4838
Labels
A-derive
Area: #[derive]` macro API
C-enhancement
Category: Raise on the bar on expectations
S-waiting-on-design
Status: Waiting on user-facing design to be resolved before implementing
Please complete the following tasks
Clap Version
4.2.2
Describe your use case
I currently have a manual test written that calls
debug_assert
.I'd like to, instead, provide a
test
argument to the#[command]
derive, and have clap generate this test for me:Describe the solution you'd like
Please add a
test
argument for the#[command]
derive that generates a test callingdebug_assert
.Alternatives, if applicable
As another alternative, clap could generate this test by default, on the theory that it doesn't do any harm if not building/running tests, and it's likely what the user wants. (In that case, though, there should probably be an option
test = false
just in case the user is doing something strange.)Additional Context
No response
The text was updated successfully, but these errors were encountered: