Shoobx / xmldiff

A library and command line utility for diffing xml
MIT License
204 stars 52 forks source link

Created a parameter for returning error code #98

Closed Glamhoth closed 1 year ago

regebro commented 1 year ago

Thanks, this looks good, but I think --check should suppress the output, since it's a check if there is a difference you don't want to deal with that output.

I also wonder if it doesn't make more sense to always return 1 when there is a difference, even without the --check parameter.

Glamhoth commented 1 year ago

I also wonder if it doesn't make more sense to always return 1 when there is a difference

I thought about it too, but I didn't want to change the default behavior. If someone is using xmldiff in their scrips/pipeline then such change could break them. I choose the --check parameter, especially after seeing your comment in #91.

but I think --check should suppress the output, since it's a check if there is a difference you don't want to deal with that output.

Actually printing output when there is a difference is quite useful (and diff does it that way). For example in my case, xmldiff is used in integration tests which are run on the CI. Output is handy to quickly see why given test failed. Suppressing output could be implemented by -q / --quiet parameter maybe?

regebro commented 1 year ago

OK, let's do it that way.

Glamhoth commented 1 year ago

@regebro conflicts are resolved

regebro commented 1 year ago

OK, I'll merge this.