kalekundert / byoc

MIT License
0 stars 0 forks source link

Provide access to parameter metadata #26

Closed kalekundert closed 2 years ago

kalekundert commented 3 years ago

I was writing some config file code for freezerbox, and as part of making a good error message, I needed to know which file each config option was loaded from. AppCLI could provide this information, but currently doesn't. I can think of a few ways to do this:

Another aspect of the freezerbox application is that I have nested dicts/lists that I would like to update (instead of replace). The metadata should reflect which keys/items came from which sources. This would have to be handled by the merge function, which would then have to take a metadata argument. (I looked for libraries that can optionally pass arguments to callbacks, and found just one: backcall. It's from the author of flit, but it doesn't support required arguments. If I go this route, I'll probably roll my own.) I'd have to provide some metadata aware functions for merging dicts/lists.