Skip to content

How to change format of error output #4595

Answered by epage
fritzrehde asked this question in Q&A
Discussion options

You must be logged in to vote

You can call clap where it returns the error, instead of directly exiting (the method depends on whether you are using Builder or Derive). You can then apply a custom ErrorFormatter and then call exit.

If you want formatted text in your error, we don't support that yet (see #3108) so you would instead get the error, directly format and print it, and then exit on your own (or apply a no-op formatter and call exit).

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@fritzrehde
Comment options

@epage
Comment options

Answer selected by fritzrehde
Comment options

You must be logged in to vote
5 replies
@epage
Comment options

@ofek
Comment options

@epage
Comment options

@ofek
Comment options

@epage
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants