mirror of
https://github.com/nushell/nushell
synced 2024-12-30 15:03:25 +00:00
use PipelineData::Value::print
to print the Value
s
For now, the result is the same as the output of the commands but piped into `str join "\n"`! Progress is being made...
This commit is contained in:
parent
2927d70fcc
commit
d2633cc59b
1 changed files with 8 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
ast::Call,
|
ast::Call,
|
||||||
engine::{EngineState, Stack},
|
engine::{EngineState, Stack},
|
||||||
Example, IntoPipelineData, Signature, Span, SyntaxShape, Value,
|
Example, IntoPipelineData, PipelineData, Signature, Span, SyntaxShape, Value,
|
||||||
};
|
};
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
|
@ -213,7 +213,13 @@ fn get_documentation(
|
||||||
|
|
||||||
match &example.result {
|
match &example.result {
|
||||||
Some(result) => {
|
Some(result) => {
|
||||||
let _ = write!(long_desc, " {}\n", result.into_string(" ", engine_state.get_config()));
|
for item in PipelineData::Value(result.clone(), None) {
|
||||||
|
let _ = write!(
|
||||||
|
long_desc,
|
||||||
|
"{}\n",
|
||||||
|
item.into_string("\n", engine_state.get_config())
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let _ = write!(long_desc, " {WD}...{RESET}\n");
|
let _ = write!(long_desc, " {WD}...{RESET}\n");
|
||||||
|
|
Loading…
Reference in a new issue