add $nothing and tests (#2995)

This commit is contained in:
Darren Schroeder
2021-02-02 00:23:12 -06:00
committed by GitHub
parent 2c52144f41
commit fd41fa31d5
2 changed files with 28 additions and 0 deletions

View File

@ -253,6 +253,11 @@ fn evaluate_reference(name: &str, ctx: &EvaluationContext, tag: Tag) -> Result<V
)),
},
"$nothing" => Ok(Value {
value: UntaggedValue::nothing(),
tag,
}),
x => match ctx.scope.get_var(x) {
Some(v) => Ok(v),
None => Err(ShellError::labeled_error(