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.
This commit is contained in:
Andrej Kolchin 2023-11-02 18:57:06 +00:00 committed by GitHub
parent 0ca8fcf58c
commit 697dee6750
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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())