- 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>
31 lines
570 B
Go
31 lines
570 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"forge.lthn.ai/core/cli/pkg/cli"
|
|
)
|
|
|
|
func addGetCommand(parent *cli.Command) {
|
|
cmd := cli.NewCommand("get", "Get a configuration value", "", func(cmd *cli.Command, args []string) error {
|
|
key := args[0]
|
|
|
|
cfg, err := loadConfig()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
var value any
|
|
if err := cfg.Get(key, &value); err != nil {
|
|
return cli.Err("key not found: %s", key)
|
|
}
|
|
|
|
fmt.Println(value)
|
|
return nil
|
|
})
|
|
|
|
cli.WithArgs(cmd, cli.ExactArgs(1))
|
|
cli.WithExample(cmd, "core config get dev.editor")
|
|
|
|
parent.AddCommand(cmd)
|
|
}
|