1
0
mirror of https://github.com/nushell/nushell.git synced 2025-07-08 02:17:22 +02:00

Merge pull request from jonathandturner/fix_809

Don't panick of no suggestions are found
This commit is contained in:
Jonathan Turner
2019-10-14 18:17:16 +13:00
committed by GitHub

@ -117,11 +117,19 @@ pub(crate) fn evaluate_baseline_expr(
possible_matches.sort();
if possible_matches.len() > 0 {
return Err(ShellError::labeled_error(
"Unknown column",
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) => {
item = next.clone().item.tagged(&tag);