diff --git a/src/commands/from_csv.rs b/src/commands/from_csv.rs index dc0426360c..1c1340092a 100644 --- a/src/commands/from_csv.rs +++ b/src/commands/from_csv.rs @@ -97,7 +97,14 @@ fn from_csv(args: CommandArgs, registry: &CommandRegistry) -> Result yield ReturnSuccess::value(x), + Ok(x) => match x { + Tagged { item: Value::List(list), .. } => { + for l in list { + yield ReturnSuccess::value(l); + } + } + x => yield ReturnSuccess::value(x), + }, Err(_) => if let Some(last_tag) = latest_tag { yield Err(ShellError::labeled_error_with_secondary( "Could not parse as CSV", diff --git a/src/commands/from_ini.rs b/src/commands/from_ini.rs index 70b34d7d50..d1f7bb4f8a 100644 --- a/src/commands/from_ini.rs +++ b/src/commands/from_ini.rs @@ -89,7 +89,14 @@ fn from_ini(args: CommandArgs, registry: &CommandRegistry) -> Result yield ReturnSuccess::value(x), + Ok(x) => match x { + Tagged { item: Value::List(list), .. } => { + for l in list { + yield ReturnSuccess::value(l); + } + } + x => yield ReturnSuccess::value(x), + }, Err(_) => if let Some(last_tag) = latest_tag { yield Err(ShellError::labeled_error_with_secondary( "Could not parse as INI", diff --git a/src/commands/from_json.rs b/src/commands/from_json.rs index 311885f458..dba9e0209f 100644 --- a/src/commands/from_json.rs +++ b/src/commands/from_json.rs @@ -95,7 +95,15 @@ fn from_json(args: CommandArgs, registry: &CommandRegistry) -> Result yield ReturnSuccess::value(x), + Ok(x) => + match x { + Tagged { item: Value::List(list), .. } => { + for l in list { + yield ReturnSuccess::value(l); + } + } + x => yield ReturnSuccess::value(x), + } Err(_) => if let Some(last_tag) = latest_tag { yield Err(ShellError::labeled_error_with_secondary( "Could not parse as JSON", diff --git a/src/commands/from_toml.rs b/src/commands/from_toml.rs index afa4085345..be9a8cc6c9 100644 --- a/src/commands/from_toml.rs +++ b/src/commands/from_toml.rs @@ -94,7 +94,14 @@ pub fn from_toml( } match from_toml_string_to_value(concat_string, span) { - Ok(x) => yield ReturnSuccess::value(x), + Ok(x) => match x { + Tagged { item: Value::List(list), .. } => { + for l in list { + yield ReturnSuccess::value(l); + } + } + x => yield ReturnSuccess::value(x), + }, Err(_) => if let Some(last_tag) = latest_tag { yield Err(ShellError::labeled_error_with_secondary( "Could not parse as TOML", diff --git a/src/commands/from_xml.rs b/src/commands/from_xml.rs index 6f7790a282..adf39240de 100644 --- a/src/commands/from_xml.rs +++ b/src/commands/from_xml.rs @@ -108,7 +108,14 @@ fn from_xml(args: CommandArgs, registry: &CommandRegistry) -> Result yield ReturnSuccess::value(x), + Ok(x) => match x { + Tagged { item: Value::List(list), .. } => { + for l in list { + yield ReturnSuccess::value(l); + } + } + x => yield ReturnSuccess::value(x), + }, Err(_) => if let Some(last_tag) = latest_tag { yield Err(ShellError::labeled_error_with_secondary( "Could not parse as XML", diff --git a/src/commands/from_yaml.rs b/src/commands/from_yaml.rs index be91bbc24e..349a6faeec 100644 --- a/src/commands/from_yaml.rs +++ b/src/commands/from_yaml.rs @@ -99,7 +99,14 @@ fn from_yaml(args: CommandArgs, registry: &CommandRegistry) -> Result yield ReturnSuccess::value(x), + Ok(x) => match x { + Tagged { item: Value::List(list), .. } => { + for l in list { + yield ReturnSuccess::value(l); + } + } + x => yield ReturnSuccess::value(x), + }, Err(_) => if let Some(last_tag) = latest_tag { yield Err(ShellError::labeled_error_with_secondary( "Could not parse as YAML",