peterbourgon / ff

Flags-first package for configuration
Apache License 2.0
1.34k stars 59 forks source link

JSON, TOML, YAML: support for nested config data #112

Closed peterbourgon closed 12 months ago

peterbourgon commented 1 year ago

This PR is a simple adaptation of the TraverseMap function from https://github.com/jolheiser/ff/pull/1 (thanks, @jolheiser!) which is applied to the JSON, TOML, and YAML config file parsers more or less in the same way. It allows nested config data in any of those formats to map to flag names in a reasonably well-defined way.

Addresses #107 and #108. I'm pretty sure this isn't a breaking change, but I'd appreciate a review from anyone who'd care to give it a look.

edit: I broke fftoml for sure, I'll fix that.

This is a precursor to a much larger refactor, including many highly requested features, coming soon to theaters near you.

peterbourgon commented 12 months ago

Thanks for your review.