From 697dee6750b6f6aa176a6501e75659c4bf8b4db1 Mon Sep 17 00:00:00 2001 From: Andrej Kolchin Date: Thu, 2 Nov 2023 18:57:06 +0000 Subject: [PATCH] Change `input list` to return null (#10913) Now the `input list` command, when nothing is selected, will return a null instead of empty string or an empty list. Resolves #10909. # User-Facing Changes `input list` now returns a `null` when nothing is selected. --- crates/nu-command/src/platform/input/list.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/platform/input/list.rs b/crates/nu-command/src/platform/input/list.rs index f380c4d5d3..d6a7250c2e 100644 --- a/crates/nu-command/src/platform/input/list.rs +++ b/crates/nu-command/src/platform/input/list.rs @@ -235,11 +235,11 @@ impl Command for InputList { opts.iter().map(|s| options[*s].value.clone()).collect(), head, ), - None => Value::list(vec![], head), + None => Value::nothing(head), }, InteractMode::Single(res) => match res { Some(opt) => options[opt].value.clone(), - None => Value::string("".to_string(), head), + None => Value::nothing(head), }, } .into_pipeline_data())