Expand description
This is test(1), not a testing mod.
We use stricter syntax here and it’s not POSIX- or fish-compatible. Specifically,
- Unary primitives always consume the next argument which must be present. They also cannot take a compound expression as argument.
- Cannot use bare strings as booleans,
-zor-nmust be used. !,(,)and strings starting with-are forbidden in binary operations.
; Expr must not contains "]" in either form.
FullArgs := "test" Expr
| "[" Expr "]"
BoolExpr := ["-f" | "-z" | ..] STR
| STR_NOT_OP_LIKE ["-ne" | "-lt" | ..] STR_NOT_OP_LIKE
| "(" Expr ")"
NotExpr := BoolExpr
| "!" NotExpr
AndExpr := NotExpr
| NotExpr "-a" AndExpr
OrExpr := AndExpr
| AndExpr "-o" OrExpr
Expr := OrExpr