mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-11-29 05:57:07 +02:00
termcolor: add support for output to standard error
This is essentially a rename of the existing `Stdout` type to `StandardStream`
and a change of its constructor from a single `new()` function to have two
`stdout()` and `stderr()` functions.
Under the hood, we add add internal IoStandardStream{,Lock} enums that allow
us to abstract between Stdout and Stderr conveniently. The rest of the needed
changes then fall out fairly naturally.
Fixes #324.
[breaking-change]
This commit is contained in:
committed by
Andrew Gallant
parent
e424f87487
commit
22cb644eb6
@@ -182,8 +182,8 @@ impl Args {
|
||||
}
|
||||
|
||||
/// Create a new writer for single-threaded searching with color support.
|
||||
pub fn stdout(&self) -> termcolor::Stdout {
|
||||
termcolor::Stdout::new(self.color_choice)
|
||||
pub fn stdout(&self) -> termcolor::StandardStream {
|
||||
termcolor::StandardStream::stdout(self.color_choice)
|
||||
}
|
||||
|
||||
/// Returns a handle to stdout for filtering search.
|
||||
|
||||
Reference in New Issue
Block a user