Changelog
Renamed the main package name from flagsbinder to just binder.
Features
-
Auto‑Discovery: Read struct fields tagged with
flag:"name,type[,choices]"and bind accordingly. -
Default Handlers: Built‑in support for:
bool→strconv.ParseBoolint→strconv.ParseIntduration→time.ParseDurationenum→ string validation against allowed choicesstrings→ split colon‑separated values into[]string
-
Custom Handlers: Override any binding with
AddBool,AddInt,AddDuration,AddEnum, orAddStrings. -
Hooks: Register
BeforeHookandAfterHookcallbacks around each binding operation. -
Batch Binding: Apply multiple key→args pairs at once with
RunAll. -
Optional Backup: Write a JSON snapshot of your struct on
NewBinder(..., autobackup=true).