forked from extern/nushell
Don't panick of no suggestions are found
This commit is contained in:
parent
7d4fec4db3
commit
7c40aed738
@ -117,11 +117,19 @@ pub(crate) fn evaluate_baseline_expr(
|
|||||||
|
|
||||||
possible_matches.sort();
|
possible_matches.sort();
|
||||||
|
|
||||||
return Err(ShellError::labeled_error(
|
if possible_matches.len() > 0 {
|
||||||
"Unknown column",
|
return Err(ShellError::labeled_error(
|
||||||
format!("did you mean '{}'?", possible_matches[0].1),
|
"Unknown column",
|
||||||
&tag,
|
format!("did you mean '{}'?", possible_matches[0].1),
|
||||||
));
|
&tag,
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
return Err(ShellError::labeled_error(
|
||||||
|
"Unknown column",
|
||||||
|
"row does not have this column",
|
||||||
|
&tag,
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Some(next) => {
|
Some(next) => {
|
||||||
item = next.clone().item.tagged(&tag);
|
item = next.clone().item.tagged(&tag);
|
||||||
|
Loading…
Reference in New Issue
Block a user