diff --git a/crates/nu-cmd-lang/src/core_commands/match_.rs b/crates/nu-cmd-lang/src/core_commands/match_.rs index db2bc2e1f0..bda42ac575 100644 --- a/crates/nu-cmd-lang/src/core_commands/match_.rs +++ b/crates/nu-cmd-lang/src/core_commands/match_.rs @@ -49,6 +49,17 @@ impl Command for Match { fn examples(&self) -> Vec { vec![ + Example { + description: "Match on a value", + example: "match 3 { 1 => 'one', 2 => 'two', 3 => 'three' }", + result: Some(Value::test_string("three")), + }, + Example { + description: "Match against alternative values", + example: + "match 'three' { 1 | 'one' => '-', 2 | 'two' => '--', 3 | 'three' => '---' }", + result: Some(Value::test_string("---")), + }, Example { description: "Match on a value in range", example: "match 3 { 1..10 => 'yes!' }",