mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 11:35:43 +02:00
Introduce metadata into the pipeline (#397)
This commit is contained in:
@ -147,7 +147,7 @@ mod test {
|
||||
assert!(call.has_flag("flag"));
|
||||
|
||||
let required: f64 = call.req(0).unwrap();
|
||||
assert_eq!(required, 1.0);
|
||||
assert!((required - 1.0).abs() < f64::EPSILON);
|
||||
|
||||
let optional: Option<String> = call.opt(1).unwrap();
|
||||
assert_eq!(optional, Some("something".to_string()));
|
||||
|
@ -145,8 +145,8 @@ impl Command for PluginDeclaration {
|
||||
})?;
|
||||
|
||||
let input = match input {
|
||||
PipelineData::Value(value) => value,
|
||||
PipelineData::Stream(stream) => {
|
||||
PipelineData::Value(value, ..) => value,
|
||||
PipelineData::Stream(stream, ..) => {
|
||||
let values = stream.collect::<Vec<Value>>();
|
||||
|
||||
Value::List {
|
||||
@ -192,7 +192,9 @@ impl Command for PluginDeclaration {
|
||||
})?;
|
||||
|
||||
match response {
|
||||
PluginResponse::Value(value) => Ok(PipelineData::Value(value.as_ref().clone())),
|
||||
PluginResponse::Value(value) => {
|
||||
Ok(PipelineData::Value(value.as_ref().clone(), None))
|
||||
}
|
||||
PluginResponse::Error(msg) => Err(ShellError::LabeledError(
|
||||
"Error received from plugin".into(),
|
||||
msg,
|
||||
|
Reference in New Issue
Block a user