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

@@ -54,7 +54,7 @@ impl Command for SubCommand {
vec![
Example {
description: "Convert value to boolean in table",
example: "echo [[value]; ['false'] ['1'] [0] [1.0] [true]] | into bool value",
example: "[[value]; ['false'] ['1'] [0] [1.0] [true]] | into bool value",
result: Some(Value::List {
vals: vec![
Value::Record {

View File

@@ -65,7 +65,8 @@ impl Command for SubCommand {
vec![
Example {
description: "Convert string to duration in table",
example: "echo [[value]; ['1sec'] ['2min'] ['3hr'] ['4day'] ['5wk']] | into duration value",
example:
"[[value]; ['1sec'] ['2min'] ['3hr'] ['4day'] ['5wk']] | into duration value",
result: Some(Value::List {
vals: vec![
Value::Record {

View File

@@ -92,7 +92,7 @@ impl Command for SubCommand {
vec![
Example {
description: "Convert string to integer in table",
example: "echo [[num]; ['-5'] [4] [1.5]] | into int num",
example: "[[num]; ['-5'] [4] [1.5]] | into int num",
result: None,
},
Example {

View File

@@ -49,7 +49,7 @@ impl Command for SubCommand {
vec![
Example {
description: "Convert from one row table to record",
example: "echo [[value]; [false]] | into record",
example: "[[value]; [false]] | into record",
result: Some(Value::Record {
cols: vec!["value".to_string()],
vals: vec![Value::boolean(false, span)],