Open
Conversation
grep: When -w wraps the pattern with boundary groups, use submatch group 2 (the word) for -o output positions instead of group 0 (which includes boundary characters). head: Add --silent as alias for --quiet using the same pattern as readlink. Parse -n value as string to support negative counts (-n -3 = all but last 3 lines). Fix expandObsoleteArgs to not expand -NUM when it follows -n/-c. cat: When -E is active without -v, convert trailing \r before \n to ^M$ to match GNU cat behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-woto output only the matched word, not boundary characters. When-wwraps the regex pattern with boundary groups, match positions now come from submatch group 2 (the word) instead of group 0 (the full match including boundary chars).--silentas alias for--quiet(matches GNU coreutils). Implement-n -Nnegative suffix to output all but the last N lines. FixexpandObsoleteArgsto not misinterpret-3as obsolete-NUMsyntax when it follows-n/-c.-Eis active without-v, convert trailing\rbefore\nto^M$to match GNU cat behavior.Test plan
-woaudit tests pass (G-03 variants)--silentalias test passes-n -3negative count test passes-ECRLF tests pass (single line, mid-line CR preserved, multiple CRLF lines)