From e259d37027039ad60494fde7d30e1ddda107a744 Mon Sep 17 00:00:00 2001 From: Bahex Date: Sat, 21 Dec 2024 22:04:24 +0300 Subject: [PATCH] fill example's description, add second example --- crates/nu-command/src/bytes/split.rs | 31 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/crates/nu-command/src/bytes/split.rs b/crates/nu-command/src/bytes/split.rs index ff3f725694..40d39e63b7 100644 --- a/crates/nu-command/src/bytes/split.rs +++ b/crates/nu-command/src/bytes/split.rs @@ -28,16 +28,27 @@ impl Command for BytesSplit { } fn examples(&self) -> Vec { - vec![Example { - example: r#"0x[66 6F 6F 20 62 61 72 20 62 61 7A 20] | bytes split 0x[20]"#, - description: "", - result: Some(Value::test_list(vec![ - Value::test_binary("foo"), - Value::test_binary("bar"), - Value::test_binary("baz"), - Value::test_binary(""), - ])), - }] + vec![ + Example { + example: r#"0x[66 6F 6F 20 62 61 72 20 62 61 7A 20] | bytes split 0x[20]"#, + description: "Split a binary value using a binary separator", + result: Some(Value::test_list(vec![ + Value::test_binary("foo"), + Value::test_binary("bar"), + Value::test_binary("baz"), + Value::test_binary(""), + ])), + }, + Example { + example: r#"0x[61 2D 2D 62 2D 2D 63] | bytes split "--""#, + description: "Split a binary value using a string separator", + result: Some(Value::test_list(vec![ + Value::test_binary("a"), + Value::test_binary("b"), + Value::test_binary("c"), + ])), + }, + ] } fn run(