mirror of
https://github.com/nushell/nushell
synced 2024-12-28 22:13:10 +00:00
writing to stdout
This commit is contained in:
parent
cf60f72452
commit
b12a265f1e
1 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
use std::io::Write;
|
||||||
|
|
||||||
use miette::{IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result};
|
||||||
use nu_cli::{report_error, NuCompleter, NuHighlighter, NuValidator};
|
use nu_cli::{report_error, NuCompleter, NuHighlighter, NuValidator};
|
||||||
use nu_command::create_default_context;
|
use nu_command::create_default_context;
|
||||||
|
@ -139,7 +141,12 @@ fn main() -> Result<()> {
|
||||||
}
|
}
|
||||||
None => value.into_string(),
|
None => value.into_string(),
|
||||||
};
|
};
|
||||||
println!("{}", output);
|
let stdout = std::io::stdout();
|
||||||
|
|
||||||
|
match stdout.lock().write_all(output.as_bytes()) {
|
||||||
|
Ok(_) => (),
|
||||||
|
Err(err) => eprintln!("{}", err),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let engine_state = engine_state.borrow();
|
let engine_state = engine_state.borrow();
|
||||||
|
|
Loading…
Reference in a new issue