mirror of
https://github.com/nushell/nushell.git
synced 2025-01-14 18:28:15 +01:00
01dd358a18
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. ```
27 lines
736 B
Rust
27 lines
736 B
Rust
/// Outputs to standard out
|
|
///
|
|
/// 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)*) }
|
|
}
|
|
|
|
/// Outputs to standard error
|
|
///
|
|
/// Note: this exists to differentiate between intentional writing to stdout
|
|
/// and stray printlns left by accident
|
|
#[macro_export]
|
|
macro_rules! errln {
|
|
($($tokens:tt)*) => { eprintln!($($tokens)*) }
|
|
}
|