mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 16:33:37 +01:00
add a key-value example to with-env
This commit is contained in:
parent
f3ee8b50e3
commit
86ef34e908
5
crates/nu-command/src/env/with_env.rs
vendored
5
crates/nu-command/src/env/with_env.rs
vendored
@ -62,6 +62,11 @@ impl Command for WithEnv {
|
||||
example: r#"with-env [[X W]; [Y Z]] { $env.W }"#,
|
||||
result: Some(Value::test_string("Z")),
|
||||
},
|
||||
Example {
|
||||
description: "Set by key-value record",
|
||||
example: r#"with-env {X: "Y", W: "Z"} { [$env.X $env.W] }"#,
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "Set by row(e.g. `open x.json` or `from json`)",
|
||||
example: r#"'{"X":"Y","W":"Z"}'|from json|with-env $in { [$env.X $env.W] }"#,
|
||||
|
Loading…
Reference in New Issue
Block a user