Add validation to command line flags + update system prompt handling
Renamed `applyPromptFlags` to `applyGenerationFlags` and added `validateGenerationFlags`
This commit is contained in:
@@ -21,7 +21,7 @@ func InputFromEditor(placeholder string, pattern string, content string) (string
|
||||
msgFile, _ := os.CreateTemp("/tmp", pattern)
|
||||
defer os.Remove(msgFile.Name())
|
||||
|
||||
os.WriteFile(msgFile.Name(), []byte(placeholder + content), os.ModeAppend)
|
||||
os.WriteFile(msgFile.Name(), []byte(placeholder+content), os.ModeAppend)
|
||||
|
||||
editor := os.Getenv("EDITOR")
|
||||
if editor == "" {
|
||||
@@ -137,8 +137,8 @@ func SetStructDefaults(data interface{}) bool {
|
||||
}
|
||||
|
||||
// Get the "default" struct tag
|
||||
defaultTag := v.Type().Field(i).Tag.Get("default")
|
||||
if defaultTag == "" {
|
||||
defaultTag, ok := v.Type().Field(i).Tag.Lookup("default")
|
||||
if (!ok) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user