mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
Update wrap example (#13986)
# Description As with #13985, credit to @AlifianK for suggesting this in https://github.com/nushell/nushell.github.io/pull/1572 Updates the example in `wrap` to not use 1-based, sequential numbers. # User-Facing Changes Help/doc only # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A
This commit is contained in:
parent
52eb9c2ef3
commit
cf5b2aeb88
@ -57,31 +57,34 @@ impl Command for Wrap {
|
||||
vec![
|
||||
Example {
|
||||
description: "Wrap a list into a table with a given column name",
|
||||
example: "[1 2 3] | wrap num",
|
||||
example: "[ Pachisi Mahjong Catan Carcassonne ] | wrap game",
|
||||
result: Some(Value::test_list(vec![
|
||||
Value::test_record(record! {
|
||||
"num" => Value::test_int(1),
|
||||
"game" => Value::test_string("Pachisi"),
|
||||
}),
|
||||
Value::test_record(record! {
|
||||
"num" => Value::test_int(2),
|
||||
"game" => Value::test_string("Mahjong"),
|
||||
}),
|
||||
Value::test_record(record! {
|
||||
"num" => Value::test_int(3),
|
||||
"game" => Value::test_string("Catan"),
|
||||
}),
|
||||
Value::test_record(record! {
|
||||
"game" => Value::test_string("Carcassonne"),
|
||||
}),
|
||||
])),
|
||||
},
|
||||
Example {
|
||||
description: "Wrap a range into a table with a given column name",
|
||||
example: "1..3 | wrap num",
|
||||
example: "4..6 | wrap num",
|
||||
result: Some(Value::test_list(vec![
|
||||
Value::test_record(record! {
|
||||
"num" => Value::test_int(1),
|
||||
"num" => Value::test_int(4),
|
||||
}),
|
||||
Value::test_record(record! {
|
||||
"num" => Value::test_int(2),
|
||||
"num" => Value::test_int(5),
|
||||
}),
|
||||
Value::test_record(record! {
|
||||
"num" => Value::test_int(3),
|
||||
"num" => Value::test_int(6),
|
||||
}),
|
||||
])),
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user