hay-kot / scaffold

A cookie cutter alternative with in-project scaffolding for generating components, controllers, or other common code patterns.
https://hay-kot.github.io/scaffold/
MIT License
51 stars 5 forks source link

Allow multiselect validation #177

Closed alexeagle closed 2 months ago

alexeagle commented 2 months ago

In my scaffold, it's a mistake to complete one of the MultiSelect fields in the form with zero selections. I'd like to have a minimum of one.

https://pkg.go.dev/github.com/charmbracelet/huh#MultiSelect.Limit seems to support only an upper-bound, so I guess it has to use https://github.com/charmbracelet/huh/blob/v0.4.2/field_multiselect.go#L55

I could make a proposal of how it would appear in the scaffold.yaml file if you like, but I'm sure you can imagine ways to express this.

alexeagle commented 2 months ago

ah, sorry this was a dupe of #142