json-diff
json-diff copied to clipboard
CLI always return exit code 1
Related issues in timeline order:
- https://github.com/andreyvit/json-diff/issues/51 => use exit code 0
- https://github.com/andreyvit/json-diff/issues/88 => use exit code 1
I think that the convention accross program is that Exit code 1 is use for errors. If you want to use it in a CI, for instance, it will always fail.
Another approach would be to keep the exit code 0 and provide more details output on if their is changes or not, or catch real errors and then exit code 1. Using exit code was cheap and fast, but it doesn't really follow the usage of command line in general.
What do you think?
For reference:
- https://stackoverflow.com/questions/20965762/meaning-of-exit-status-1-returned-by-linux-command
- https://stackoverflow.com/questions/36530696/linux-how-to-get-error-description-by-error-number/36566055#36566055