Skip to content

Write messages to stderr instead of stdout #1784

Answered by tzakharko
tzakharko asked this question in Q&A
Discussion options

You must be logged in to vote

For now I have solved it with

App::new(...).
...
 .get_matches_safe()
 .unwrap_or_else(|err| {
     eprintln!("{}", err.message);
     std::process::exit(1);
});

It works, but feels a bit ugly to me. Anyway, it would be nice if Error:: use_stderr() were configurable in some way instead of hard-coded like it is now.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pksunkara
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants