Commit edf84d21 authored by Leah Neukirchen's avatar Leah Neukirchen

make prune evaluate to false

parent 7f683af9
## HEAD
* **Breaking change**: `prune` now evaluates to a false value.
The common find(1) idiom is now best written as `name = "x" ? prune : print`.
* Feature: new option `-B` for breadth first traversal.
* Feature: new syntax `? :` for ternary operator.
......
......@@ -304,6 +304,12 @@ List all files, but print them in red if they match "havoc":
% lr -G -t 'name =~ "havoc" && color 160 || print'
```
Do not enter `.git` or `.hg` directories:
```
% lr -t 'name = ".git" || name = ".hg" ? prune : print' .
```
## Installation
Use `make all` to build, `make install` to install relative to `PREFIX`
......
......@@ -1227,7 +1227,7 @@ eval(struct expr *e, struct fileinfo *fi)
return !eval(e->a.expr, fi);
case EXPR_PRUNE:
prune = 1;
return 1;
return 0;
case EXPR_PRINT:
return 1;
case EXPR_COLOR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment