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:
Reilly Wood
2022-12-16 08:51:00 -08:00
committed by GitHub
parent 9c1a3aa244
commit e72cecf457
32 changed files with 64 additions and 59 deletions

View File

@ -13,7 +13,7 @@ impl HashDigest for Md5 {
vec![
Example {
description: "Return the md5 hash of a string, hex-encoded",
example: "echo 'abcdefghijklmnopqrstuvwxyz' | hash md5",
example: "'abcdefghijklmnopqrstuvwxyz' | hash md5",
result: Some(Value::String {
val: "c3fcd3d76192e4007dfb496cca67e13b".to_owned(),
span: Span::test_data(),
@ -21,7 +21,7 @@ impl HashDigest for Md5 {
},
Example {
description: "Return the md5 hash of a string, as binary",
example: "echo 'abcdefghijklmnopqrstuvwxyz' | hash md5 --binary",
example: "'abcdefghijklmnopqrstuvwxyz' | hash md5 --binary",
result: Some(Value::Binary {
val: vec![
0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00, 0x7d, 0xfb, 0x49, 0x6c,

View File

@ -13,7 +13,7 @@ impl HashDigest for Sha256 {
vec![
Example {
description: "Return the sha256 hash of a string, hex-encoded",
example: "echo 'abcdefghijklmnopqrstuvwxyz' | hash sha256",
example: "'abcdefghijklmnopqrstuvwxyz' | hash sha256",
result: Some(Value::String {
val: "71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73"
.to_owned(),
@ -22,7 +22,7 @@ impl HashDigest for Sha256 {
},
Example {
description: "Return the sha256 hash of a string, as binary",
example: "echo 'abcdefghijklmnopqrstuvwxyz' | hash sha256 --binary",
example: "'abcdefghijklmnopqrstuvwxyz' | hash sha256 --binary",
result: Some(Value::Binary {
val: vec![
0x71, 0xc4, 0x80, 0xdf, 0x93, 0xd6, 0xae, 0x2f, 0x1e, 0xfa, 0xd1, 0x44,