You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The USAGE output is always the same, regardless of whether the user supplies --help or makes a usage error.
Actual Behavior Summary
Usage with --help:
USAGE:
render <CONFIG> [ARGS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
ARGS:
<CONFIG> the configuration file
<WIDTH> texture width [default: 512]
<HEIGHT> texture height [default: 512]
Usage with a bad input:
error: The following required arguments were not provided:
<CONFIG>
USAGE:
render <CONFIG> <WIDTH> <HEIGHT>
For more information try --help
Note how <WIDTH> and <HEIGHT> are shown as required arguments.
Steps to Reproduce the issue
Call the executable created from the code below once with --help and once without any arguments.
@dotdash apologies for the long time in answering this, I've been out of town for work.
In that usage line <width> and <height> are not shown as required arguments, they're shown as used arguments (a default is considered used). When clap detects an argument was used (required or not) it will inject those arguments into the usage string of errors. It's a manner of saying, "It seems like you were trying to do this... X ... but here's how you can correct it."
I agree this could be improved by not displaying arguments which only contain the default value. I can keep this on the issue tracker, but there are a few more pressing issues to fix first ;)
There's also the case of it'd be nice to inject the actual value the users used for those args (non-defaults only). I should be able to start knocking this out after the new year.
Affected Version of clap
2.19.2
Expected Behavior Summary
The
USAGE
output is always the same, regardless of whether the user supplies--help
or makes a usage error.Actual Behavior Summary
Usage with
--help
:Usage with a bad input:
Note how
<WIDTH>
and<HEIGHT>
are shown as required arguments.Steps to Reproduce the issue
Call the executable created from the code below once with
--help
and once without any arguments.Sample Code or Link to Sample Code
The text was updated successfully, but these errors were encountered: