From 5483519c7d639e5fbf4d5fc14c5af1fd5c4ec02a Mon Sep 17 00:00:00 2001 From: Tyarel8 <98483313+Tyarel8@users.noreply.github.com> Date: Sun, 18 May 2025 05:31:46 +0200 Subject: [PATCH] fix `kv set` examples (#15769) As talked in #15588, I have updated the examples of `kv set` so that it correctly shows how to use the command with closures. --- crates/nu-std/std-rfc/kv/mod.nu | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/nu-std/std-rfc/kv/mod.nu b/crates/nu-std/std-rfc/kv/mod.nu index 95d90282e1..41cc757407 100644 --- a/crates/nu-std/std-rfc/kv/mod.nu +++ b/crates/nu-std/std-rfc/kv/mod.nu @@ -21,8 +21,13 @@ @example "Store a number" { kv set foo 5 } -@example "Update a number" { - kv set foo { $in + 1 } +@example "Update a number and return it" { + let $new_foo = (kv get foo | kv set foo { $in + 1 } --return value) +} +@example "Use a single pipeline with closures" { + ls + | kv set names { get name } + | kv set sizes { get size } } export def "kv set" [ key: string