Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement smart usage #82

Closed
kbknapp opened this issue Apr 29, 2015 · 2 comments
Closed

Implement smart usage #82

kbknapp opened this issue Apr 29, 2015 · 2 comments
Labels
C-enhancement Category: Raise on the bar on expectations

Comments

@kbknapp
Copy link
Member

kbknapp commented Apr 29, 2015

Usage strings, if possible should be re-generated upon error for the current usage case. For example if you have a non-required by default argument which requires another argument, and the user fails to supply the third argument (which is required by proxy), the usage string is generic - yet the error message says a required argument is missing...which argument?

let m = App::new("app")
                .arg(Arg::from_usage("--reqs").requires("input"))
                .arg_from_usage("[input] 'some input'")
                .get_matches();

Run with app --reqs and the usage does not identify [input] as a requirement, yet states a generic "required argument missing"

Now this does happen in certain instances, but I want to implement it in all instances.

@kbknapp
Copy link
Member Author

kbknapp commented Apr 30, 2015

Closed with #90

@kbknapp kbknapp closed this as completed Apr 30, 2015
kbknapp added a commit that referenced this issue Apr 30, 2015
Adds support for #88 

Closes #89
Closes #88 
Closes #82
@kbknapp
Copy link
Member Author

kbknapp commented May 1, 2015

Usage strings are now recalculated on errors, so that the current usage attempt is a template and all requirements/conflicts are spelled out in the usage string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

1 participant