homeport / dyff

/ˈdʏf/ - diff tool for YAML files, and sometimes JSON
MIT License
1.28k stars 60 forks source link

No documentation for format of --exclude and --include options #305

Open werdnum opened 1 year ago

werdnum commented 1 year ago

It's very unclear what format the --exclude and --include options are supposed to take.

A bit of code-diving indicates that maybe they can take the "Go-Patch" style or the "Dot-Style" formats, but I have no idea what those are and I can't turn up any actual specifications for these formats – I can barely even find examples.

The --exclude-regexp and --include-regexp options are even more opaque, but reading through the code it seems like these regexps are maybe applied to "Go-Patch style" paths (per #266)?

I also note that even when I seemingly correctly specify --exclude-regexp '\/(status|metadata)\/.*', I still get the following in the output:

/
- one map entry removed:
  status:
    loadBalancer: {}

... presumably because the 'change' is the removal of a child of a root element rather than deletion of the 'status' element, which seems a particularly obtuse way of interpreting my intent.

Can we please have some documentation for how these fields are parsed and applied?

tavlima commented 1 year ago

This is as far as I could track it down. At a glance, still cryptic... 😩

https://github.com/gonvenience/ytbx/blob/main/path.go