Repository navigation
refactor/3.5c gnu rest - #247
Merged
Merged
Conversation
sf624
added this pull request to stack #250
October 23, 2026 11:48
Contributor
|
Web preview: https://sf624.github.io/bash-explainer/pr/247/ (commit 54a1c2c) |
sf624
force-pushed
the
refactor/3.5c-gnu-rest
branch
from
October 23, 2026 12:02
23d3de3 to
e0c8204
Compare
Merged
…flicting matchers; OpenSSL's --name (refactor 3.5, D3) GNU coreutils (in commands.ts, basic.ts, distro.ts, system.ts, admin.ts, ops.ts), diffutils, gzip and tar use the getopt_long parser, with `--help`, `--version` (GNU_INFO, now in types.ts) and every long option of their `--help`. test/prefixes-real.test.ts checks each of them against the tool; stty checks its words before getopt_long, so its prefixes are checked with ours and one row runs it. The check found options whose value differed from the tool's: `od -w` and `--width`, `split --numeric-suffixes`, the optional values of `sort --check`, `ls --classify`, `cp --update`, `tail --follow`, `diff --unified`, `shred --remove` and others; `install -t` was missing. tar's `-k` and `--wildcards` texts are fixed. grep's matchers select modes, and `conflictingModes` says that grep refuses two different ones (`grep -E -F`: "conflicting matchers specified", status 2), as rows against GNU grep show. The `openssl` preset reads `--name` as `-name`, as OpenSSL's opt.c does; single-dash is compared with gcc, which refuses `--dumpversion`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sf624
force-pushed
the
refactor/3.5c-gnu-rest
branch
from
October 23, 2026 13:03
e0c8204 to
54a1c2c
Compare
This branch was previously deployed
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.
Refactor step 3.5 (option parsing), layer 1 of 3.
Addresses: D3 (rest)
getopt_longparser, with every long option of their--help: coreutils in every dict file (about 90 entries; notdd,expr), diffutils, gzip/gunzip/zcat and GNU tar. Each is in test/prefixes-real.test.ts's list, which runs the tool for every long option and its shortest unique prefix. The check found value kinds that differed from the tools (od -w,split --numeric-suffixes, the long forms ofls -F,cp -u,tail -f,diff -u,shred -utake an optional value;install -twas missing; tar's-k,--wildcardstexts).grep -E -F(two different matchers): grep's matchers select modes, and the newCommandSpec.conflictingModesadds grep's refusal ("conflicting matchers specified", status 2) to the second one; 9 rows against GNU grep in prefixes-real.openssl(single-dash, and--nameis-name, as OpenSSL's opt.c reads it);single-dashis now compared with gcc. Go's flag package reads--nametoo, but no Go tool is installed to compare with: go, terraform and shfmt stay onsingle-dash(recorded in the table).CHANGELOG: the prefix bullet is extended; new bullets for
grep -E -Fandopenssl --hex. sample.sh dump unchanged.Review fixes: a refused line (
grep -E -F) is markedrefusedin the parse, so it gets no pipeline example and its pattern no regex reading (rows in prefixes-real); tar's operations useconflictingModestoo (tar -c -x,tar cxf; 6 rows against GNU tar); prefixes-real tolerates other tool releases (RELEASES comment); gzip--asciitext.Checks:
npm test,extract-snippets --check, Node 24 coverage (every line and branch) pass.🤖 Generated with Claude Code