Skip to content

Commit

Permalink
Merge pull request #87 from cgwalters/patch-1
Browse files Browse the repository at this point in the history
cmd: Note trailing newlines are trimmed
  • Loading branch information
matklad authored Jun 8, 2024
2 parents c300b94 + d8adc22 commit 7dc60e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,12 +966,12 @@ impl<'a> Cmd<'a> {
self.output_impl(false, false).map(|_| ())
}

/// Run the command and return its stdout as a string.
/// Run the command and return its stdout as a string. Any trailing newline or carriage return will be trimmed.
pub fn read(&self) -> Result<String> {
self.read_stream(false)
}

/// Run the command and return its stderr as a string.
/// Run the command and return its stderr as a string. Any trailing newline or carriage return will be trimmed.
pub fn read_stderr(&self) -> Result<String> {
self.read_stream(true)
}
Expand Down

0 comments on commit 7dc60e2

Please sign in to comment.