use PipelineData::Value::print to print the Values

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:
amtoine 2023-02-24 10:14:32 +01:00
parent 2927d70fcc
commit d2633cc59b
No known key found for this signature in database
GPG key ID: 37AAE9B486CFF1AB

View file

@ -1,7 +1,7 @@
use nu_protocol::{
ast::Call,
engine::{EngineState, Stack},
Example, IntoPipelineData, Signature, Span, SyntaxShape, Value,
Example, IntoPipelineData, PipelineData, Signature, Span, SyntaxShape, Value,
};
use std::fmt::Write;
@ -213,7 +213,13 @@ fn get_documentation(
match &example.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 => {
let _ = write!(long_desc, " {WD}...{RESET}\n");