wader / fq

jq for binary formats - tool, language and decoders for working with binary and text formats

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Apple Binary Property List Enhancement: Timestamps

dgmcdona opened this issue · comments

Per @wader 's comment in the original PR, it would be nice to add an option for bplist decoding to display time values as timestamps instead of just CocoaDate floating point values in torepr/tovalue representations (and maybe elsewhere?).

Is there guidance or a good reference commit somewhere that shows how to add decode options for specific formats?

Not at the moment, should add something. But it should no more than add a *In struct to format.go with "doc" struct field tags, there is also *Out struct:s for decoder who output, not that common. Then in the decoders decode.Format struct fill in the DecodeInArg field with default values and add a type assert for the in arg in the decode function, hope that is all. Maybe mp3.go is a good example. After that the rest of fq's code should take care of help texts and make it possible pass the option in a object to the decode function (key as snake_case).

About what to name the options there no conventions yet, try come up with something an will see how it feels.