diff --git a/src/commands/get.rs b/src/commands/get.rs index 930392e5d6..afa550c72c 100644 --- a/src/commands/get.rs +++ b/src/commands/get.rs @@ -58,11 +58,14 @@ fn get_member(path: &Tagged, obj: &Tagged) -> Result 0 { + return Err(ShellError::labeled_error( + "Unknown column", + format!("did you mean '{}'?", possible_matches[0].1), + path.tag(), + )); + } + None } } } @@ -72,7 +75,18 @@ fn get_member(path: &Tagged, obj: &Tagged) -> Result Ok(v.clone()), - None => Ok(Value::nothing().tagged(obj.tag)), + None => match obj { + // If its None check for certain values. + Tagged { + item: Value::Primitive(Primitive::String(_)), + .. + } => Ok(obj.clone()), + Tagged { + item: Value::Primitive(Primitive::Path(_)), + .. + } => Ok(obj.clone()), + _ => Ok(Value::nothing().tagged(obj.tag)), + }, } }