From 1f44aafa41174e7e8442179c526ed313d09e0bda Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Tue, 29 Sep 2026 14:36:40 +0200 Subject: Correct CLI information flags and reject unknown long options --- README.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 74af167..8bf8c12 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ cargo install --path . usage: aip-filter [-p|--print] [--max-record-bytes N] [--] [file...] ``` +* `--help` and `--version` print information and exit successfully without reading input. +* Unknown long options fail. Use `--` before an expression that starts with `--`, including filter comments. * `--print` prints the parsed expression instead of evaluating it. * If no files are given, reads from stdin. * Input is newline-delimited JSON, with one value per line. Matching lines are preserved, with a newline inserted between records when a preceding input file has no trailing newline. A final unterminated record is otherwise left unchanged. @@ -23,6 +25,7 @@ usage: aip-filter [-p|--print] [--max-record-bytes N] [--] [file...] * Invalid JSON lines are reported and skipped. Any invalid JSON or input/output error causes a nonzero exit status. * Records are limited to 8 MiB by default, including the newline. `--max-record-bytes N` sets a positive byte limit. Oversized records are reported and skipped without buffering the rest of the line; later records are still processed and the exit status indicates failure. The limit does not apply to an empty filter, which copies bytes directly. * Memory depends on the largest allowed record and its parsed JSON values, not on the total number of records. The record limit is not a process-memory limit. +* Exit status is 0 for successful processing, even with no matches; 1 for filter, data, or I/O errors; and 2 for invalid command-line usage. ### Matching rules -- cgit v1.3.1