mirror of
https://github.com/nushell/nushell.git
synced 2025-01-03 04:50:28 +01:00
fill example's description, add second example
This commit is contained in:
parent
9342c91c55
commit
e259d37027
@ -28,16 +28,27 @@ impl Command for BytesSplit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![Example {
|
vec![
|
||||||
example: r#"0x[66 6F 6F 20 62 61 72 20 62 61 7A 20] | bytes split 0x[20]"#,
|
Example {
|
||||||
description: "",
|
example: r#"0x[66 6F 6F 20 62 61 72 20 62 61 7A 20] | bytes split 0x[20]"#,
|
||||||
result: Some(Value::test_list(vec![
|
description: "Split a binary value using a binary separator",
|
||||||
Value::test_binary("foo"),
|
result: Some(Value::test_list(vec![
|
||||||
Value::test_binary("bar"),
|
Value::test_binary("foo"),
|
||||||
Value::test_binary("baz"),
|
Value::test_binary("bar"),
|
||||||
Value::test_binary(""),
|
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(
|
fn run(
|
||||||
|
Loading…
Reference in New Issue
Block a user