feat: add a normalized :Forge parser/dispatcher with strict bang validation #143
Labels
No labels
bug
documentation
duplicate
enhancement
fugitive
good first issue
help wanted
invalid
question
v0.1.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/forge.nvim#143
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Prerequisites
Problem
Issue #142 proposes a canonical Ex-style
:Forgecommand language, but the current implementation inplugin/forge.luais still an ad hoc positional parser.That parser currently:
Without a normalized parser/dispatcher, the new CLI will stay brittle.
Proposed solution
Add a dedicated command parser/dispatcher layer for
:Forge.Responsibilities
Parse a command line into a normalized command object:
familyverbsubjectsmodifiersbangValidate:
Dispatch the normalized command to the existing operation layer.
Example normalized forms
:Forge pr list state=closed repo=upstream->:Forge! release delete v1.2.3 repo=upstream->Bang behavior
Use
-bangon the top-level user command, but enforce legality after parsing.If
!is not supported by the resolved subcommand, abort with:E477: No ! allowedNo side effects should occur before that validation.
Suggested implementation split
lua/forge/cmd.luafor tokenizer/parser/validator/dispatcherplugin/forge.luareduced to user-command entrypoint + completion hookupAcceptance criteria
E477: No ! allowedAlternatives considered
Implemented in #149.