Don't emit a newline in autoview. (#1466)

The extra newline character makes it hard to use nu as part of an
external processing pipeline, since the extra character could taint the
results. For example:

```
$ nu -c 'echo test | xxd'
00000000: 7465 7374                                test
```

versus

```
nu -c 'echo test' | xxd
00000000: 7465 7374 0a                             test.
```
This commit is contained in:
Jason Gedge
2020-03-08 15:18:24 -04:00
committed by GitHub
parent 50fb97f6b7
commit 01dd358a18
3 changed files with 20 additions and 11 deletions

View File

@ -3,6 +3,15 @@
/// Note: this exists to differentiate between intentional writing to stdout
/// and stray printlns left by accident
#[macro_export]
macro_rules! out {
($($tokens:tt)*) => { print!($($tokens)*) }
}
/// Outputs to standard out with a newline added
///
/// Note: this exists to differentiate between intentional writing to stdout
/// and stray printlns left by accident
#[macro_export]
macro_rules! outln {
($($tokens:tt)*) => { println!($($tokens)*) }
}