-.TH zpm-vercmp 8 2018-12-10 "ZPM 0.4"
+.TH zpm-vercmp 8 2019-02-26 "ZPM 0.4"
.SH NAME
zpm-vercmp \- compare strings with version numbering
.SH SYNOPSIS
.B zpm vercmp \fR[\fB-q\fR] \fIstring1 string2\fR
.SH DESCRIPTION
-\fBzpm-vercmp\fR compares its first two arguments, using
-the usual version numbering semantics. It will write
-the result of the comparison to stdout, 0 if the arguments
-compare equal, -1 if the first is greater, and 1 if the
-second is greater.
+\fBzpm-vercmp\fR compares its arguments, using
+version numbering semantics. It can operate in
+test mode or search mode. In search mode, activated with \-G or \-L
+it will print the highest or lowest version string to stdout.
+.PP
+In test mode, it compares all the arguments, and prints '0' if they are all
+equal, '-1' if they are in version order, and 1 if they are out of order.
+Adjacent identical version strings are considered both equal and in order.
+Additionally in test mode,
+the process will exit 0 if the strings are all equal, 1 if the
+strings are not in order, and 2 if they are in order.
.SH OPTIONS
.TP
\-q
write nothing to stdout. The program will still exit with the
usual exit status
+.TP
+\-G
+Print the largest argument version string found.
+.TP
+\-L
+Print the smallest argument version string found.
.SH EXAMPLES
.PP
.nf
-zpm-vercmp a b -> "1"
+zpm-vercmp a b -> "-1"
.fi
.SH EXIT STATUS
-0 if the two strings compare equal
--1 if the first string is greater than the second
-1 if the second string is greater then the first
+.TP
+0
+if the strings are all equal
+.TP
+1
+if the strings are not in version order
+.TP
+2
+if the strings are in version order
.SH FILES
None
.SH ENVIRONMENT