forked from extern/nushell
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:
parent
0ca8fcf58c
commit
697dee6750
@ -235,11 +235,11 @@ impl Command for InputList {
|
|||||||
opts.iter().map(|s| options[*s].value.clone()).collect(),
|
opts.iter().map(|s| options[*s].value.clone()).collect(),
|
||||||
head,
|
head,
|
||||||
),
|
),
|
||||||
None => Value::list(vec![], head),
|
None => Value::nothing(head),
|
||||||
},
|
},
|
||||||
InteractMode::Single(res) => match res {
|
InteractMode::Single(res) => match res {
|
||||||
Some(opt) => options[opt].value.clone(),
|
Some(opt) => options[opt].value.clone(),
|
||||||
None => Value::string("".to_string(), head),
|
None => Value::nothing(head),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
.into_pipeline_data())
|
.into_pipeline_data())
|
||||||
|
Loading…
Reference in New Issue
Block a user