mirror of
https://github.com/nushell/nushell.git
synced 2025-01-23 06:39:17 +01:00
Improve do command docs (#6975)
This commit is contained in:
parent
2c4048eb43
commit
36ae384fb3
@ -23,7 +23,7 @@ impl Command for Do {
|
|||||||
.required("block", SyntaxShape::Any, "the block to run")
|
.required("block", SyntaxShape::Any, "the block to run")
|
||||||
.switch(
|
.switch(
|
||||||
"ignore-errors",
|
"ignore-errors",
|
||||||
"ignore errors as the block runs",
|
"ignore shell errors as the block runs",
|
||||||
Some('i'),
|
Some('i'),
|
||||||
)
|
)
|
||||||
.switch(
|
.switch(
|
||||||
@ -186,10 +186,15 @@ impl Command for Do {
|
|||||||
result: Some(Value::test_string("hello")),
|
result: Some(Value::test_string("hello")),
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Run the block and ignore errors",
|
description: "Run the block and ignore shell errors",
|
||||||
example: r#"do -i { thisisnotarealcommand }"#,
|
example: r#"do -i { thisisnotarealcommand }"#,
|
||||||
result: None,
|
result: None,
|
||||||
},
|
},
|
||||||
|
Example {
|
||||||
|
description: "Abort the pipeline if a program returns a non-zero exit code",
|
||||||
|
example: r#"do -c { nu -c 'exit 1' } | myscarycommand"#,
|
||||||
|
result: None,
|
||||||
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Run the block, with a positional parameter",
|
description: "Run the block, with a positional parameter",
|
||||||
example: r#"do {|x| 100 + $x } 50"#,
|
example: r#"do {|x| 100 + $x } 50"#,
|
||||||
|
Loading…
Reference in New Issue
Block a user