File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -226,15 +226,23 @@ func NewRunCommand() *cobra.Command {
226226 modelName = args [0 ]
227227 }
228228
229+ noMatchErrorMessage := "The specified model name is not found. Run 'gh models list' to see available models or 'gh models run' to select interactively."
230+
231+ if modelName == "" {
232+ return errors .New (noMatchErrorMessage )
233+ }
234+
235+ foundMatch := false
229236 for _ , model := range models {
230237 if strings .EqualFold (model .FriendlyName , modelName ) || strings .EqualFold (model .Name , modelName ) {
231238 modelName = model .Name
239+ foundMatch = true
232240 break
233241 }
234242 }
235243
236- if modelName == "" {
237- return errors .New ("the specified model name is not supported" )
244+ if ! foundMatch {
245+ return errors .New (noMatchErrorMessage )
238246 }
239247
240248 initialPrompt := ""
You can’t perform that action at this time.
0 commit comments