diff --git a/crates/nu-command/src/filters/default.rs b/crates/nu-command/src/filters/default.rs index 8f78323c0c..5988f63a9b 100644 --- a/crates/nu-command/src/filters/default.rs +++ b/crates/nu-command/src/filters/default.rs @@ -43,6 +43,12 @@ impl Command for Default { example: "ls -la | default 'nothing' target ", result: None, }, + Example { + description: + "Get the env value of `MY_ENV` with a default value 'abc' if not present", + example: "$env | get -i MY_ENV | default 'abc'", + result: None, // Some(Value::test_string("abc")), + }, Example { description: "Default the `$nothing` value in a list", example: "[1, 2, $nothing, 4] | default 3",