feat(passthrough): strip redundant -- after a passthrough bin (urfave/cli v3 reorder workaround) #94

Closed
opened 2026-06-07 04:07:40 +00:00 by coilysiren · 1 comment
Owner

Extraction candidate from the coily cmd/coily/ generic-code audit (2026-06-06). Source pinned at coily commit c7c17cb (canonical: forgejo.coilysiren.me/coilyco-bridge/coily). cli-guard is mid-refactor, so the "suggested home" below is the pre-refactor package layout - land this in whatever the post-refactor equivalent is, not necessarily the named package. The durable principle: the classifiers / argv-transforms are generic and move; the policy decisions and message copy stay in coily.

Source: cmd/coily/passthrough_sep.go - stripPassthroughSeparator, predicate isPassthroughCommandPos.

What it does: strips the redundant -- separator immediately after a registered passthrough bin in command position (e.g. coily ops aws -- sts get-caller-identity). Works around urfave/cli v3 reordering trailing flags across -- for SkipFlagParsing passthroughs.

Generic core (lift this): stripPassthroughSeparator is a pure argv transform fixing a framework-level urfave/cli v3 bug that every guarded passthrough CLI hits.

Consumer seam to parameterize: isPassthroughCommandPos hardcodes coily's ops/pkg group layout and reads coily's passthrough registries. Replace with a caller-supplied predicate func(argv []string, i int) bool (or a registry abstraction).

Suggested home (pre-refactor): extend passthrough.

Done when:

  • generic logic lives in cli-guard with zero coily/Kai/Forgejo identifiers or defaults
  • behavior-covered tests (table tests where the source has them)
  • godoc-current.txt regenerated (scripts/check-godoc-current.sh --update)
  • coily migrated onto the extracted API, its local copy deleted, make test green both sides
  • closes this issue

Why first: smallest surface, pure transform, single-predicate seam, and it benefits every consumer the moment it lands - good candidate to set the extraction pattern.

> Extraction candidate from the coily `cmd/coily/` generic-code audit (2026-06-06). Source pinned at coily commit `c7c17cb` (canonical: `forgejo.coilysiren.me/coilyco-bridge/coily`). **cli-guard is mid-refactor**, so the "suggested home" below is the pre-refactor package layout - land this in whatever the post-refactor equivalent is, not necessarily the named package. The durable principle: **the classifiers / argv-transforms are generic and move; the policy decisions and message copy stay in coily.** **Source:** `cmd/coily/passthrough_sep.go` - `stripPassthroughSeparator`, predicate `isPassthroughCommandPos`. **What it does:** strips the redundant `--` separator immediately after a registered passthrough bin in command position (e.g. `coily ops aws -- sts get-caller-identity`). Works around urfave/cli v3 reordering trailing flags across `--` for `SkipFlagParsing` passthroughs. **Generic core (lift this):** `stripPassthroughSeparator` is a pure argv transform fixing a **framework-level urfave/cli v3 bug** that every guarded passthrough CLI hits. **Consumer seam to parameterize:** `isPassthroughCommandPos` hardcodes coily's `ops`/`pkg` group layout and reads coily's passthrough registries. Replace with a caller-supplied predicate `func(argv []string, i int) bool` (or a registry abstraction). **Suggested home (pre-refactor):** extend `passthrough`. **Done when:** - [ ] generic logic lives in cli-guard with zero coily/Kai/Forgejo identifiers or defaults - [ ] behavior-covered tests (table tests where the source has them) - [ ] `godoc-current.txt` regenerated (`scripts/check-godoc-current.sh --update`) - [ ] coily migrated onto the extracted API, its local copy deleted, `make test` green both sides - [ ] `closes` this issue **Why first:** smallest surface, pure transform, single-predicate seam, and it benefits every consumer the moment it lands - good candidate to set the extraction pattern.
Author
Owner

Backlog burndown 2026-06-17: closing low-priority (P3/P4) to bring the open count to a manageable level. Nothing lost — reopen if this resurfaces. Batch tag: burndown-2026-06.

Backlog burndown 2026-06-17: closing low-priority (P3/P4) to bring the open count to a manageable level. Nothing lost — reopen if this resurfaces. Batch tag: `burndown-2026-06`.
coilysiren 2026-06-17 08:23:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/cli-guard#94
No description provided.