Make Unicode listing GNU-sed compatible - #537
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #537 +/- ##
==========================================
+ Coverage 83.18% 83.20% +0.02%
==========================================
Files 13 13
Lines 7001 7010 +9
Branches 398 398
==========================================
+ Hits 5824 5833 +9
Misses 1174 1174
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the l (list) command output to be GNU-sed compatible by defaulting to octal-escaped UTF-8 bytes for non-ASCII, while introducing a -U/--uutil-extensions flag to preserve uutils-specific \uXXXX / \UXXXXXXXX Unicode escape listing.
Changes:
- Change
lcommand listing behavior to emit octal byte escapes by default (even under UTF-8 locales), reserving\u/\UUnicode escapes for--uutil-extensions. - Add
-U/--uutil-extensionsCLI flag and plumb it throughProcessingContext. - Add/adjust fixtures and tests to cover both default octal behavior and extension-enabled Unicode-escape behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/fixtures/sed/output/list_unicode_octal | Adds expected output fixture for default octal UTF-8 byte escaping in l output. |
| tests/by-util/test_sed.rs | Updates Unicode listing tests to cover both extension-enabled and default behaviors. |
| src/sed/processor.rs | Switches l behavior based on uutil_extensions and character mode. |
| src/sed/mod.rs | Adds -U/--uutil-extensions flag and wires it into context construction and tests. |
| src/sed/command.rs | Extends ProcessingContext with uutil_extensions. |
| README.md | Documents the new incompatible-extensions toggle and its effect on l output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Merging this PR will regress 1 benchmark
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | access_log_subst |
2.4 s | 2.5 s | -6.33% |
| ⚡ | number_fix |
1.4 s | 1.3 s | +9.78% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing dspinellis:octal-list (1688d27) with main (7be1f77)
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.
Adjust
lcommand 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.This implementation is compatible with the byte-handling changes and also retains the useful \u behavior, which #436 would loose.