From a0902fe51010645f779e4d02cd46f35e488b8bd2 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Mon, 23 May 2022 15:29:11 +0100 Subject: Return non-zero exit status if "compare" finds differences This makes `metastore` more useful in scripts, just to check if it found anything, in the same way as `diff` and `grep`. Note that POSIX requires that EXIT_SUCCESS is 0, and EXIT_FAILURE is 1, so I've defined EXIT_DIFFERENCES as 2 which, while different from the values `diff` and `grep` use (1 for finding something, 2 for errors), maintains a certain amount of backwards compatibility with previous versions of metastore. --- man1/metastore.1 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'man1') diff --git a/man1/metastore.1 b/man1/metastore.1 index f9d1755..67926e1 100644 --- a/man1/metastore.1 +++ b/man1/metastore.1 @@ -81,6 +81,11 @@ Alternatively, one or more paths can be specified and they will each be examined. Later invocations should be made using the exact same paths to ensure that the stored metadata is interpreted correctly. .\" +.SH EXIT STATUS +metastore returns an exit status of 0 on success, or 1 if an error occurred. If +the \fBcompare\fR action is selected and differences are found, the exit status +is 2. +.\" .SH FORMATS .TP .B 0 -- cgit v1.2.1