This repository has been archived by the owner on Jan 1, 2022. It is now read-only.
takes_value()
parameters with default_value()
are shown in USAGE like mandatory
#86
Milestone
Issue by albel727
Friday Jan 05, 2018 at 22:04 GMT
Originally opened as clap-rs/clap#1140
Affected Version of clap
clap 2.29.0
Expected Behavior Summary
When command line parsing fails, a USAGE section is shown. This usage section should NOT contain non-required parameters with default values. Suppose there are two parameters, "required" and "defaulted", and the user didn't specify the required one. The output should be as follows
Actual Behavior Summary
Defaulted option parameters are mentioned in parse error help for no particular reason, confusingly looking like they're mandatory, even if they're
required(false)
.Steps to Reproduce the issue
Utilize the following code. Note that if one comments out ".default_value()", the parse error no longer contains the mention of the defaulted parameter, as expected.
Sample Code or Link to Sample Code
The text was updated successfully, but these errors were encountered: