Unify Go CLIs on flaggy (bash complete, flags at any position) #34

Closed
opened 2026-08-14 11:53:50 +01:00 by eSlider · 2 comments
Owner

Why

Too many hand-rolled ParseArgs loops plus flag.NewFlagSet. stdlib flag drops flags after positionals (search q --hop 1 became query q 1).

Decision (D23)

integrii/flaggy v1.8 — zero deps, flags at any position, completion bash|zsh|fish.
Wrapper: internal/cli. Dump: bin/cli/complete.go bash.
No cobra. Search does not intercept the word completion (that is a query).

Done when

  • All Go tools parse via flaggy/internal/cli
  • Existing rank ParseArgs tests still pass
  • source <(./bin/cli/complete.go bash) lists --json / --hop for search
## Why Too many hand-rolled `ParseArgs` loops plus `flag.NewFlagSet`. stdlib `flag` drops flags after positionals (`search q --hop 1` became query `q 1`). ## Decision (D23) [`integrii/flaggy`](https://github.com/integrii/flaggy) v1.8 — zero deps, flags at any position, `completion bash|zsh|fish`. Wrapper: `internal/cli`. Dump: `bin/cli/complete.go bash`. No cobra. Search does **not** intercept the word `completion` (that is a query). ## Done when - [ ] All Go tools parse via flaggy/`internal/cli` - [ ] Existing rank ParseArgs tests still pass - [ ] `source <(./bin/cli/complete.go bash)` lists `--json` / `--hop` for search
eSlider added this to the v2 milestone 2026-08-14 11:53:50 +01:00
Author
Owner

PR: https://github.com/eSlider/2dph/pull/36 + Gitea feat/cli-flaggy.

flaggy + internal/cli. Completions: source <(./bin/cli/complete.go bash). Жду CI, потом squash-merge.

PR: https://github.com/eSlider/2dph/pull/36 + Gitea `feat/cli-flaggy`. flaggy + `internal/cli`. Completions: `source <(./bin/cli/complete.go bash)`. Жду CI, потом squash-merge.
Author
Owner

In on main (0c4bb87). GitHub squash https://github.com/eSlider/2dph/pull/36. Gitea main synced. Closing #34.

In on `main` (`0c4bb87`). GitHub squash https://github.com/eSlider/2dph/pull/36. Gitea `main` synced. Closing #34.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eSlider/2dph#34