diff --git a/crates/nu-command/src/filters/all.rs b/crates/nu-command/src/filters/all.rs index aa36118273..844d845a54 100644 --- a/crates/nu-command/src/filters/all.rs +++ b/crates/nu-command/src/filters/all.rs @@ -30,6 +30,11 @@ impl Command for All { fn examples(&self) -> Vec { vec![ + Example { + description: "Check if a list contains only true values", + example: "[false true true false] | all {}", + result: Some(Value::test_bool(false)), + }, Example { description: "Check if each row's status is the string 'UP'", example: "[[status]; [UP] [UP]] | all {|el| $el.status == UP }", diff --git a/crates/nu-command/src/filters/any.rs b/crates/nu-command/src/filters/any.rs index 230a96ebe7..3d6f5404a2 100644 --- a/crates/nu-command/src/filters/any.rs +++ b/crates/nu-command/src/filters/any.rs @@ -30,6 +30,11 @@ impl Command for Any { fn examples(&self) -> Vec { vec![ + Example { + description: "Check if a list contains any true values", + example: "[false true true false] | any {}", + result: Some(Value::test_bool(true)), + }, Example { description: "Check if any row's status is the string 'DOWN'", example: "[[status]; [UP] [DOWN] [UP]] | any {|el| $el.status == DOWN }",