cli: add NewPassthrough builder for flag.FlagSet commands #12
Labels
No labels
needs-review
needs-review
needs-review
needs-review
needs-review
needs-review
needs-review
athena
athena-gemini
audit
clotho
clotho-gemini
codex
darbs-claude
security
wiki
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: core/go#12
Loading…
Add table
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?
Problem
Commands migrating incrementally from
flag.FlagSetto cobra needDisableFlagParsing = trueso cobra doesn't reject unknown flags. LEM had to write a local helper:Every domain repo doing incremental migration will need the same pattern.
Proposal
Add
cli.NewPassthroughtopkg/cli/command.go:Context
LEM has 24 commands using this pattern (Phase 1 passthrough). go-ml will need it too when migrating from
init() + cli.RegisterCommands()toWithCommands.Acceptance
cli.NewPassthrough(use, short, fn)exists inpkg/cli/command.goDisableFlagParsing = trueis setCompleted by Charon in
core/cli(e360115). CLI package now lives atforge.lthn.ai/core/cli/pkg/cli, notcore/go/pkg/cli.