Skip to content

Commit 5483519

Browse files
authored
fix kv set examples (nushell#15769)
As talked in nushell#15588, I have updated the examples of `kv set` so that it correctly shows how to use the command with closures.
1 parent 457f162 commit 5483519

File tree

1 file changed

+7
-2
lines changed
  • crates/nu-std/std-rfc/kv

1 file changed

+7
-2
lines changed

crates/nu-std/std-rfc/kv/mod.nu

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@
2121
@example "Store a number" {
2222
kv set foo 5
2323
}
24-
@example "Update a number" {
25-
kv set foo { $in + 1 }
24+
@example "Update a number and return it" {
25+
let $new_foo = (kv get foo | kv set foo { $in + 1 } --return value)
26+
}
27+
@example "Use a single pipeline with closures" {
28+
ls
29+
| kv set names { get name }
30+
| kv set sizes { get size }
2631
}
2732
export def "kv set" [
2833
key: string

0 commit comments

Comments
 (0)