mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 16:05:01 +02:00
Remove unnecessary echo
uses from examples (#7500)
`echo` tends to confuse new Nu users; they expect it to work like `print` when it just passes a value to the next stage of the pipeline. We haven't quite figured out what to do about `echo` in the long run, but I think a good start is to remove `echo` from command examples where it would be unnecessary and arguably unidiomatic.
This commit is contained in:
4
crates/nu-command/src/env/load_env.rs
vendored
4
crates/nu-command/src/env/load_env.rs
vendored
@ -86,12 +86,12 @@ impl Command for LoadEnv {
|
||||
vec![
|
||||
Example {
|
||||
description: "Load variables from an input stream",
|
||||
example: r#"{NAME: ABE, AGE: UNKNOWN} | load-env; echo $env.NAME"#,
|
||||
example: r#"{NAME: ABE, AGE: UNKNOWN} | load-env; $env.NAME"#,
|
||||
result: Some(Value::test_string("ABE")),
|
||||
},
|
||||
Example {
|
||||
description: "Load variables from an argument",
|
||||
example: r#"load-env {NAME: ABE, AGE: UNKNOWN}; echo $env.NAME"#,
|
||||
example: r#"load-env {NAME: ABE, AGE: UNKNOWN}; $env.NAME"#,
|
||||
result: Some(Value::test_string("ABE")),
|
||||
},
|
||||
]
|
||||
|
2
crates/nu-command/src/env/with_env.rs
vendored
2
crates/nu-command/src/env/with_env.rs
vendored
@ -64,7 +64,7 @@ impl Command for WithEnv {
|
||||
},
|
||||
Example {
|
||||
description: "Set by row(e.g. `open x.json` or `from json`)",
|
||||
example: r#"'{"X":"Y","W":"Z"}'|from json|with-env $in { echo $env.X $env.W }"#,
|
||||
example: r#"'{"X":"Y","W":"Z"}'|from json|with-env $in { [$env.X $env.W] }"#,
|
||||
result: None,
|
||||
},
|
||||
]
|
||||
|
Reference in New Issue
Block a user