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

feat(error): Expose error building blocks #3402

Merged
merged 35 commits into from Feb 7, 2022
Merged

Conversation

epage
Copy link
Member

@epage epage commented Feb 4, 2022

This has some limited programmatic use but the focus is on allowing people to format the errors as they wish.

Downside is that the .text section for the git example went from 547.9KiB to 566.8KiB. Error::formatted is the sixth largest clap function at 6.0KiB.

Fixes #2628
Fixes #3227

@ducaale
Copy link
Contributor

ducaale commented Feb 5, 2022

Can you add a brief example of how users could format errors after this change? Thanks

@epage
Copy link
Member Author

epage commented Feb 5, 2022

Can you add a brief example of how users could format errors after this change? Thanks

It might not stay this way but as of right now, this PR has clap format using context so it serves as its own example (and makes sure the data is complete enough)

fn formatted(&self) -> Cow<'_, Colorizer> {

@epage epage marked this pull request as ready for review February 7, 2022 19:04
@epage epage merged commit 6bfe7f5 into clap-rs:master Feb 7, 2022
@epage epage deleted the context branch February 7, 2022 21:37
@epage epage mentioned this pull request Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants