Assemble PromptKit profiles for offline configuration inspection
This commit is contained in:
@@ -19,6 +19,7 @@ type configInput struct {
|
||||
ConfigPath string
|
||||
ConfigPathSet bool
|
||||
Overlay string
|
||||
View string
|
||||
TranscriptPath string
|
||||
GlossaryPath string
|
||||
OutputPath string
|
||||
@@ -40,6 +41,9 @@ func parseConfigInput(command string, args []string, output io.Writer) (configIn
|
||||
fs.SetOutput(output)
|
||||
configPath := fs.String("config", "", "Main configuration YAML file")
|
||||
overlay := fs.String("overlay", "", "Selected configuration overlay")
|
||||
if command == "print-effective" {
|
||||
fs.String("view", "settings", "Effective view: settings, profiles, or explain")
|
||||
}
|
||||
settingPaths := map[string]ck.Path{
|
||||
"proposal-profile": ck.Keys("llm", "proposal_profile"),
|
||||
"validation-profile": ck.Keys("llm", "validation_profile"),
|
||||
@@ -106,6 +110,14 @@ func parseConfigInput(command string, args []string, output io.Writer) (configIn
|
||||
return configInput{}, false, fmt.Errorf("unexpected positional arguments")
|
||||
}
|
||||
input.ConfigPath, input.Overlay = *configPath, *overlay
|
||||
if command == "print-effective" {
|
||||
input.View = fs.Lookup("view").Value.String()
|
||||
switch input.View {
|
||||
case "settings", "profiles", "explain":
|
||||
default:
|
||||
return configInput{}, false, fmt.Errorf("unknown effective view %q", input.View)
|
||||
}
|
||||
}
|
||||
fs.Visit(func(f *flag.Flag) {
|
||||
if f.Name == "config" {
|
||||
input.ConfigPathSet = true
|
||||
|
||||
Reference in New Issue
Block a user