Commit 589243c7 authored by Leah Neukirchen's avatar Leah Neukirchen

add action 'skip' which is always false

parent 6d84edf8
......@@ -2,6 +2,9 @@
* Feature: new option `-B` for breadth first traversal.
* Feature: new syntax `? :` for ternary operator.
* Feature: new action `skip` which is always false.
The common find(1) idiom `-name x -prune -o -print`
is now best written as `name = "x" ? prune && skip : print`.
* Significant speed-up as tsearch is not used anymore.
## 1.1 (2017-10-29)
......
......@@ -150,6 +150,7 @@ Default: `n`.
| <modetest>
| prune -- do not traverse into subdirectories
| print -- always true value
| skip -- always true value
| color <num> -- always true value, override 256-color
<timeprop> ::= atime | ctime | mtime
......
......@@ -295,6 +295,7 @@ tests are given by the following EBNF:
| <modetest>
| prune -- do not traverse into subdirectories
| print -- always true value
| skip -- always false value
| color <num> -- always true value, override 256-color
<timeprop> ::= atime | ctime | mtime
......
......@@ -417,6 +417,11 @@ parse_inner()
} else if (token("print")) {
struct expr *e = mkexpr(EXPR_PRINT);
return e;
} else if (token("skip")) {
struct expr *e = mkexpr(EXPR_PRINT);
struct expr *not = mkexpr(EXPR_NOT);
not->a.expr = e;
return not;
} else if (token("color")) {
struct expr *e = mkexpr(EXPR_COLOR);
int64_t n;
......
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