51 Commits
Author SHA1 Message Date
Sylvestre Ledru 5c98e4d68f docs: move extensions and incompatibilities to docs/src/extensions.md
Start an mdBook under docs/, laid out as in coreutils, and move the list of
extensions and incompatibilities out of the README into it. The README keeps
a pointer.

A Documentation workflow builds the book with mdbook 0.5.0, the version the
uutils website uses, whenever docs/ changes, and uploads it as an artifact.
mdbook 0.5 rejects the `multilingual` field coreutils still carries (the
website strips it before building), so the book leaves it out.
2026-09-26 20:05:52 +02:00
Jorge Polanco e5474abccf sed: implement the GNU R command (read one line from a file)
The R command reads one line at a time from a named file. All R commands
naming the same file share a single cursor so they read successive lines,
matching GNU sed. Rejected under --sandbox like the other file commands.

Includes unit and integration tests. Makes the GNU sed testsuite `cmd-R`
test pass.
2026-09-25 09:00:25 +02:00
Diomidis Spinellis f1c5813aa4 Make Unicode listing GNU-sed compatible (#537)
Adjust `l` command to list Unicode characters by default as
octal byte sequences of the corresponding UTF-8 bytes.
A new -U --uutil-extensions option allows listing them
with the common Unicode \u and \U hex escapes.
2026-08-29 23:24:09 +02:00
Diomidis SpinellisandMukunda Katta b038f8fb2d Implement GNU W (write pattern first line) command (#531)
While at it, also fix the w command on patterns missing a newline.

Co-authored-by: Mukunda Katta <mukunda.vjcs6@gmail.com>
2026-08-26 16:29:57 +02:00
Diomidis Spinellis b39a9eaa05 Add mandelbrot.sed to integration tests and update goals
Updated README to reflect the addition of mandelbrot.sed in integration tests and improved GNU sed compatibility goals.
2026-08-23 09:37:22 +03:00
Diomidis Spinellis 79e5df0df8 Document F command extension 2026-08-19 14:32:26 +03:00
Sylvestre Ledru 079eb9340e Add cargo-binstall support (#520)
Point cargo-binstall at the archives published by dist in the GitHub
releases, so 'cargo binstall sed' fetches a prebuilt binary instead of
building from source.
2026-08-09 10:00:46 +02:00
Diomidis Spinellis e9792a8ef9 Improve GNU compatibility through byte processing (#487)
The original Rust implementation assummed a UTF-8 environment, as is
common in modern systems.  This commit improves GNU sed compatibility
by changing most processing to run on bytes rather than Rust's Unicode
characters and strings. This change also improves the handling of binary
files. The commit adds a simple POSIX-compatible locale configuration
to support UTF-8 processing when specified. While at it, also fix
script-specified file handling to take place through OsString and
add a few missing unit tests.

The change fixes two failing GNU test suite cases.
2026-07-26 19:44:54 +02:00
Diomidis Spinellis 01c8412327 Optimize multiline matching (#483)
The multiline matching resulted in a large performance regression due to
the indiscriminate use of the dotall (?s) flag.  Change the regex
selection process to use only the flag when probably needed.
2026-07-05 15:13:53 +02:00
Diomidis Spinellis a9e5fe778c Add sandbox checks (#477)
Following the introduction of the first sandbox check in b14272c1
complete the checks for the remaining commands.
2026-07-03 16:55:50 +02:00
Diomidis Spinellis cd3b10db48 Document uutils Playground 2026-07-01 10:48:54 +03:00
Diomidis Spinellis 48c2f56358 Document r command extension 2026-07-01 10:42:22 +03:00
Diomidis Spinellis 3b846498f4 Add current POSIX specification link
Link to POSIX document to help contributors.
2026-06-01 21:41:25 +03:00
mukunda katta f6e69e734b fix: preserve latest binary executable mode 2026-05-24 17:57:32 +02:00
LoukasPap 5e9b821d80 Set max addresses to 2 for a, i and = and make n_addr conditional, based on POSIX flag
- Update `get_cmd_spec()` and `get_verified_cmd_spec()` to accept a boolean POSIX param
- Add unit and high level tests
- Update README.md
2026-03-19 22:21:56 +01:00
Kevin BurkeandClaude Opus 4.6 16f11456b3 fix: rewrite GNU testsuite harness to run upstream test scripts directly
The previous harness tried to extract sed commands from GNU test scripts
via regex pattern matching, which produced false negatives (comparing
against empty expected output) and false positives. This led to inflated
test counts and unreliable pass/fail signals.

The new approach:
- Provides a lightweight shim for the gnulib test framework (init.sh)
  with implementations of compare_, returns_, skip_, framework_failure_,
  and all require_* functions
- Executes each .sh test script from the GNU testsuite directly,
  injecting our Rust sed binary via PATH
- Uses a clean srcdir with symlinks to real test data files
- Adds per-test timeout (10s) to catch infinite loops, with SIGTERM
  isolation so timeout signals don't kill the parent script
- Properly propagates exit codes (0=pass, 77=skip, 99=framework failure)

Results are now consistent with CI tracking (~12% pass rate) with
clear PASS/FAIL/SKIP/timeout categorization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 22:04:56 +01:00
Sylvestre Ledru 91affcf90b Update CodeCov badge to point to main branch 2026-02-15 12:11:40 +01:00
oech3 1617d32d5d README.md: Link tag/latest-commit 2026-01-28 11:12:45 +01:00
Diomidis Spinellis 8039955354 Add support for GNU ~step address ranges 2026-01-28 08:40:54 +01:00
Diomidis Spinellis a0d82d678d Support ranges starting from line 0
This is a GNU extension that starts the range as latched.
While at it, also fix the handling of ranges straddling independent
files.
2026-01-28 08:40:54 +01:00
Sylvestre Ledru 5d452d4174 link to the sed tracking project 2026-01-11 21:12:00 +01:00
Sylvestre Ledru 3fa2227ebf Run against the GNU implementation (#223)
* Add a script to run the sed testsuite

* run the gnu testsuite in the ci

* remove useless comment
2025-12-21 13:05:37 +01:00
Sylvestre Ledru 8b6ff1d86a generate the sed binary directly 2025-12-14 18:07:22 +01:00
Sylvestre Ledru 380a0a74d6 README: explain how to call it sed 2025-11-23 22:43:46 +01:00
Sylvestre Ledru c47f7c94fb README: improve the syntax 2025-11-23 22:39:44 +01:00