forked from extern/nushell
Move $nu.env to $env (#665)
* Move env from nu builtin to its own * update samples/tests
This commit is contained in:
8
crates/nu-command/src/env/with_env.rs
vendored
8
crates/nu-command/src/env/with_env.rs
vendored
@ -48,22 +48,22 @@ impl Command for WithEnv {
|
||||
vec![
|
||||
Example {
|
||||
description: "Set the MYENV environment variable",
|
||||
example: r#"with-env [MYENV "my env value"] { $nu.env.MYENV }"#,
|
||||
example: r#"with-env [MYENV "my env value"] { $env.MYENV }"#,
|
||||
result: Some(Value::test_string("my env value")),
|
||||
},
|
||||
Example {
|
||||
description: "Set by primitive value list",
|
||||
example: r#"with-env [X Y W Z] { $nu.env.X }"#,
|
||||
example: r#"with-env [X Y W Z] { $env.X }"#,
|
||||
result: Some(Value::test_string("Y")),
|
||||
},
|
||||
Example {
|
||||
description: "Set by single row table",
|
||||
example: r#"with-env [[X W]; [Y Z]] { $nu.env.W }"#,
|
||||
example: r#"with-env [[X W]; [Y Z]] { $env.W }"#,
|
||||
result: Some(Value::test_string("Z")),
|
||||
},
|
||||
Example {
|
||||
description: "Set by row(e.g. `open x.json` or `from json`)",
|
||||
example: r#"echo '{"X":"Y","W":"Z"}'|from json|with-env $it { echo $nu.env.X $nu.env.W }"#,
|
||||
example: r#"echo '{"X":"Y","W":"Z"}'|from json|with-env $it { echo $env.X $env.W }"#,
|
||||
result: None,
|
||||
},
|
||||
]
|
||||
|
Reference in New Issue
Block a user