are there additional conditionals that can be used for the where command aside from ==, >, <
I've been wondering about this too. I'd love a contains or regex match (=~?) for strings, but that doesn't seem possible at the moment.
If someone points me how, I could add this.
So the where seems to have some SyntaxShape::Block with the condition? But in this file I don't understand whats happening
https://github.com/nushell/nushell/blob/388fc241914c11587006e32a872883428a75ccd3/src/parser/hir/syntax_shape/block.rs
I'd love to help out, but I'm not sure where to go either. If you look at src/data/base.rs you'll find an impl Block block which has an invoke function. Looks like this is used later on. Following on from that, in src/evaluate/evaluator.rs, you have the evaluate_baseline_expr, which evaluates expressions. It gets pretty abstract from there, but that might be a clue, at least.
Edit:
Here's the line using invoke from src/commands/where_.rs
GitHub link
// .... snip ...
Tagged {
item: Value::Block(block),
..
} => {
let result = block.invoke(&input_clone);
match result {
// ... snip ...
This is now documented as part of the where command: https://www.nushell.sh/commands/where.html
Most helpful comment
I've been wondering about this too. I'd love a
containsor regex match (=~?) for strings, but that doesn't seem possible at the moment.