- Split frame.go: extract built-in components to frame_components.go - Replace custom indexOf with strings.Index in frame_test.go - Make prompt.go testable: accept io.Reader via SetStdin, add tests - Decompose runGoQA: extract emitQAJSON and emitQASummary helpers - DRY: centralise loadConfig into cmd/config/cmd.go - Remove hardcoded MACOSX_DEPLOYMENT_TARGET from test/fuzz/cov commands - Add error assertions to coverage_test.go Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
582 B
Go
25 lines
582 B
Go
package config
|
|
|
|
import (
|
|
"forge.lthn.ai/core/cli/pkg/cli"
|
|
"forge.lthn.ai/core/go-config"
|
|
)
|
|
|
|
// AddConfigCommands registers the 'config' command group and all subcommands.
|
|
func AddConfigCommands(root *cli.Command) {
|
|
configCmd := cli.NewGroup("config", "Manage configuration", "")
|
|
root.AddCommand(configCmd)
|
|
|
|
addGetCommand(configCmd)
|
|
addSetCommand(configCmd)
|
|
addListCommand(configCmd)
|
|
addPathCommand(configCmd)
|
|
}
|
|
|
|
func loadConfig() (*config.Config, error) {
|
|
cfg, err := config.New()
|
|
if err != nil {
|
|
return nil, cli.Wrap(err, "failed to load config")
|
|
}
|
|
return cfg, nil
|
|
}
|