avamsi / climate

"CLI Mate" autogenerates CLIs from structs / functions (nested subcommands, global / local flags, help generation, typo suggestions, shell completion etc.)
https://pkg.go.dev/github.com/avamsi/climate#section-documentation
The Unlicense
147 stars 3 forks source link

Consider taking pointers to structs as input #10

Closed avamsi closed 1 year ago

avamsi commented 1 year ago

Users can then just pre-populate the default values (and so we can get rid of default struct tags and string parsing them as supported types) but OTOH, it does move the implicit default documentation away from where the field is defined and users could pre-populate parent commands too (although we don't support that -- we could technically support it though at the expense of some end user confusion?).

avamsi commented 1 year ago

Implementation wise, there's reflect.Value.Bool() etc. to get these default values in type.

avamsi commented 1 year ago

Alas, this wouldn't work for method opts :(, so, gg.