Visitar URL original
Restore the beta.19 verb-slot rule of command words by Aaronontheweb · Pull Request #241 · Aaronontheweb/ShellSyntaxTree · GitHub
Skip to content

Restore the beta.19 verb-slot rule of command words - #241

Merged
Aaronontheweb merged 1 commit into
devfrom
fix/restore-verb-slot-rule
Oct 6, 2026
Merged

Aaronontheweb merged 1 commit into
devfrom
fix/restore-verb-slot-rule

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Owner

Fixes #240

What changed

  • Restore the 0.4.0-beta.19 verb-slot rule of CommandOccurrence.CommandWords. ShellCommandWordProjection.cs is identical to 0.4.0-beta.19. In the verb slot, a plain word directly after an option stays a command word. After the verb slot, an option value is skipped as before.
  • Reason (owner decision): without per-program grammar, a value-less flag followed by a subcommand cannot be told apart from an option value. In 0.4.0-beta.20, dropping the word let short grants cover hidden programs: git --no-pager push gave git, xargs -0 rm gave xargs, and env -i rm gave env.
  • Prepare 0.4.0-beta.21 (version, release notes, README, SPEC, consumer guide, plan). SPEC and the guide return to the beta.19 text, with a short note on the revert.

Tests

  • The beta.20 inputs stay. Their expectations change to the beta.19 results, with the reason in a comment (Bash_verb_slot_keeps_the_word_after_an_option, PowerShell_verb_slot_keeps_the_word_after_an_option, Bash_exact_option_binding_keeps_the_next_word_in_the_verb_slot).
  • New pins (Verb_slot_word_after_a_switch_stays_visible): docker --debug run → docker run, docker --debug run img → docker run img, ilspycmd -t X /p/x.dll → ilspycmd X, git --no-pager push → git push, xargs -0 rm → xargs rm, env -i rm → env rm.
  • The tests that beta.20 changed return to their beta.19 expectations (owner table, Bash_verb_slot_keeps_a_plain_word_after_an_option, hiding attempts, PowerShell position rule and words, exact binding words, the seeded option-order table, and the launch-value test). The extra inputs that beta.20 added stay, for example r=push; git -C . "$r" and git -C . "$SUB".
  • New: git log --pretty=oneline main → git log main. A manual mutant that ignores an inline option value survived the full suite on beta.19 code. This test kills it.

Evidence

  • dotnet test -c Release: 4621 passed, 0 failed. Build: 0 warnings. Header check passes. Pack gives ShellSyntaxTree.0.4.0-beta.21.nupkg.
  • Output comparison: the same 6,057 inputs and 109,960 records as for beta.20. The beta.21 dump is byte-identical to the beta.19 dump in both launch modes. Against beta.20, only CommandWords changes, in the same 186 inputs.
  • Manual mutants (each built and run): 4 killed, 0 survived. They cover the beta.20 rule, no option-value skip, option values skipped only in the slot, and an ignored inline value.
  • Public API: no change.

@Aaronontheweb
Aaronontheweb merged commit d197ba3 into dev Oct 6, 2026
2 checks passed
@Aaronontheweb
Aaronontheweb deleted the fix/restore-verb-slot-rule branch October 6, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command words: restore the beta.19 verb-slot rule

1 participant