mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 20:37:59 +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:
@ -36,8 +36,8 @@ impl Command for IsAdmin {
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![
|
||||
Example {
|
||||
description: "Echo 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not.",
|
||||
example: r#"if is-admin { echo "iamroot" } else { echo "iamnotroot" }"#,
|
||||
description: "Return 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not.",
|
||||
example: r#"if is-admin { "iamroot" } else { "iamnotroot" }"#,
|
||||
result: Some(Value::string("iamnotroot", Span::test_data())),
|
||||
},
|
||||
]
|
||||
|
Reference in New Issue
Block a user