Skip to content

Route no-arg pigo update to binary self-update (#468) - #472

Merged
smallnest merged 1 commit into
masterfrom
feat/issue-468-update-dispatch
Aug 1, 2026
Merged

Route no-arg pigo update to binary self-update (#468)#472
smallnest merged 1 commit into
masterfrom
feat/issue-468-update-dispatch

Conversation

@smallnest

Copy link
Copy Markdown
Owner

Summary

  • Add updateIsSelfUpdate pure classifier in cmd/pigo/main.go: no positional package name (including flags-only invocations like pigo update --check) routes to binary self-update; a package name routes to pkgmgr package-update.
  • Formalize the US-003 dispatch split, replacing the old len(os.Args)==2 check so flags-only invocations also reach self-update.
  • Delete the now-dead no-arg package-all-update path: remove pkgmgr.UpdateAll and the empty-name branch in runUpdate (empty name list is now a usage error), per the binding "no-arg = self-update, drop package-all-update" design.
  • Add TestUpdateIsSelfUpdate covering 7 classification cases.

Closes #468

Test plan

  • go build ./...
  • go vet ./cmd/pigo/ ./internal/cli/pkgcmd/ ./internal/pkgmgr/
  • go test ./cmd/pigo/ ./internal/pkgmgr/ (pkgcmd has no test files)

Add updateIsSelfUpdate classifier: no positional package name (incl.
flags-only like --check) routes to binary self-update; a package name
stays pkgmgr package-update. Delete the now-dead no-arg package-all-
update path (pkgmgr.UpdateAll) per the no-arg=self-update design.
@smallnest
smallnest merged commit 2ca3fd7 into master Aug 1, 2026
1 check passed
@smallnest
smallnest deleted the feat/issue-468-update-dispatch branch August 1, 2026 01:45
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.

保持 pigo update <包名> 包更新语义并分发无参数自更新

1 participant