mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 21:57:50 +02:00
Stdout/Stderr redirection (#7185)
This adds new pipeline connectors called out> and err> which redirect either stdout or stderr to a file. You can also use out+err> (or err+out>) to redirect both streams into a file.
This commit is contained in:
@ -53,6 +53,20 @@ impl RawStream {
|
||||
|
||||
Ok(Spanned { item: output, span })
|
||||
}
|
||||
|
||||
pub fn chain(self, stream: RawStream) -> RawStream {
|
||||
RawStream {
|
||||
stream: Box::new(self.stream.chain(stream.stream)),
|
||||
leftover: self
|
||||
.leftover
|
||||
.into_iter()
|
||||
.chain(stream.leftover.into_iter())
|
||||
.collect(),
|
||||
ctrlc: self.ctrlc,
|
||||
is_binary: self.is_binary,
|
||||
span: self.span,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Debug for RawStream {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
|
Reference in New Issue
Block a user