Repository navigation
refactor/3.5d examples - #248
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/248/ (commit 1ed7310) |
sf624
force-pushed
the
refactor/3.5d-examples
branch
from
October 23, 2026 12:02
2a65a1c to
4ec58c9
Compare
…5, D2 rest, D1 rest) parseOptions (textfilters.ts) builds its result from interpret() with the dictionary spec; its tables only say which options each simulator follows. sedArgs, perlOptions, awkInvocation, xargs, read and the yq -o format read the parse too. Spec fixes found on the way, checked against the tools: seq (optionsFirst, a negative number ends the options), tail +N, awk and perl read options only before the program, tr -C, cut -n. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sf624
force-pushed
the
refactor/3.5d-examples
branch
from
October 23, 2026 13:03
4ec58c9 to
1ed7310
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 2 of 3. Stacked on #247.
Addresses: D2 (rest), D1 (rest)
parseOptions(src/examples/textfilters.ts) builds its result frominterpret()with the command's dictionary spec; its tables only say which options each simulator follows. Its callers (sort, uniq, cut, tr, head, tail, seq, basename, dirname, wc, grep,read, xargs),sedArgs,perlOptionsand xargs's-0/-dcheck read the parse. Example tables unchanged, with new rows for what is now followed (sort --rev,tr -C, xargs--replace…) and for what is declined as the tools refuse (grep -E -F,seq 1 -w 3).awkInvocationand the yq-oformat read the parse too.tail +2; awk and perl read options only before the program;tr -C;cut -n(test/options-fixes.test.ts). The cat, tac and rev runners pass the input on only without options or files (cat -nnumbers the lines; examples-pipeline).CHANGELOG: the "Examples and dialect checks…" bullet and the prefix bullet are extended. sample.sh dump unchanged.
Left:
sed -ion stdin is simulated where GNU sed fails.Review fixes: yq v4 reads
-o=jsonas pflag does (cobra preset);cat -n f | sortgets no example (the first-stage cat check reads the parse);git log --max-count 2shows 2 commits (the git log example reads the parse; rows against git); perl-l0and-0777take their octal digits (ValueSpec.attachedMatch; rows against perl); the getopt example reads the parse, and getopt reads its own options first, as util-linux does. The tilde rows in branches.test.ts stay: coverage needs them (comment).Checks:
npm test,extract-snippets --check, Node 24 coverage (every line and branch) pass.🤖 Generated with Claude Code