feat(command): port expr from just-bash
Evaluate arithmetic, comparison, logical, and string expressions.
Mirrors the just-bash recursive-descent parser, including its
JS-isms — parseInt's lenient leading-digit semantics for numeric
detection, JS substring's clamping/swap behavior for substr, and
the parseOr early-return short-circuit. Regex matching uses Go's
RE2 directly (the TS source goes through RE2JS), and length/index
operate on runes rather than UTF-16 code units. Exit code is 1
when the result is "0" or empty, 2 on missing operand or
evaluation error, matching GNU expr.
Signed-off-by: Xe Iaso <me@xeiaso.net>
Assisted-by: Claude Opus 4.7 via Claude Code