[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/cli/RFC.md fully. Find ONE feature ... #49
2 changed files with 15 additions and 4 deletions
|
|
@ -165,9 +165,6 @@ func addPkgUpdateCommand(parent *cobra.Command) {
|
|||
Short: i18n.T("cmd.pkg.update.short"),
|
||||
Long: i18n.T("cmd.pkg.update.long"),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if !updateAll && len(args) == 0 {
|
||||
return errors.New(i18n.T("cmd.pkg.error.specify_package"))
|
||||
}
|
||||
return runPkgUpdate(args, updateAll)
|
||||
},
|
||||
}
|
||||
|
|
@ -197,7 +194,7 @@ func runPkgUpdate(packages []string, all bool) error {
|
|||
}
|
||||
|
||||
var toUpdate []string
|
||||
if all {
|
||||
if all || len(packages) == 0 {
|
||||
for _, r := range reg.List() {
|
||||
toUpdate = append(toUpdate, r.Name)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,3 +291,17 @@ func TestRunPkgSearch_RespectsLimitWithCachedResults(t *testing.T) {
|
|||
assert.Contains(t, out, "core-alpha")
|
||||
assert.NotContains(t, out, "core-beta")
|
||||
}
|
||||
|
||||
func TestRunPkgUpdate_NoArgs_UpdatesAll(t *testing.T) {
|
||||
tmp := setupOutdatedRegistry(t)
|
||||
withWorkingDir(t, tmp)
|
||||
|
||||
out := capturePkgOutput(t, func() {
|
||||
err := runPkgUpdate(nil, false)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
assert.Contains(t, out, "updating")
|
||||
assert.Contains(t, out, "core-fresh")
|
||||
assert.Contains(t, out, "core-stale")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue