瀏覽代碼

Add default title to choices

jamesread 4 年之前
父節點
當前提交
6357c9dc61
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      internal/config/sanitize.go

+ 6 - 0
internal/config/sanitize.go

@@ -38,6 +38,12 @@ func sanitizeActionArgument(arg *ActionArgument) {
 		arg.Title = arg.Name
 		arg.Title = arg.Name
 	}
 	}
 
 
+	for idx, choice := range arg.Choices {
+		if choice.Title == "" {
+			arg.Choices[idx].Title = choice.Value
+		}
+	}
+
 	sanitizeActionArgumentNoType(arg)
 	sanitizeActionArgumentNoType(arg)
 
 
 	// TODO Validate the default against the type checker, but this creates a
 	// TODO Validate the default against the type checker, but this creates a