Author: Adam <git@apiote.tk>
document output format in manpage
meowsum.1.scd | 25 ++++++++++++++++++++++++- meowsum.c | 2 +-
diff --git a/meowsum.1.scd b/meowsum.1.scd index 8512c03cc13ef3a1eb9590f66ad79e7cae7abf74..e7ef0a380790be3e4782b4a1365804492148ab92 100644 --- a/meowsum.1.scd +++ b/meowsum.1.scd @@ -14,11 +14,12 @@ meowsum [-s size] FILE... # DESCRIPTION -The meowsum utility calculates and prints or checks Meow hash checksums. +The meowsum utility calculates and prints or verifies Meow hash checksums. The output format is consistent with POSIX cksum; meowsum prints the checksum, number of bytes, and file path to standard output. When FILE is -, meowsum reads standard input. +Checksums calculated from standard input are skipped when verifying. # OPTIONS @@ -30,6 +31,28 @@ The following options are useful only when verifying checksums:++ \-q only return status; do not print OK, ERH, ERS, ERM++ \-e fail for missing files + +# OUTPUT + +When calculating checksums, for each FILE one line is printed to standard +output: +``` +CHECKSUM SIZE FILE +``` +where CHECKSUM is hexadecimal digest of calculated checksum, and SIZE is number +of bytes in the file. + +When verifying checksums, errors are printed to stderr, and, unless there has +been and error, for each line in each FILE one line is printed to standard +output: +``` +STATUS FILE +``` +where STATUS is: +- OK - if checksum and size are correct +- ERM - if file is missing +- ERH - if checksum is not correct +- ERS - if checksum is correct but size is not # AUTHORS diff --git a/meowsum.c b/meowsum.c index 3c69bd7477be179a16b1e7d8178dc25532f1caaf..1e55a25fc29618a2c0b752d3540d12b7010fabee 100644 --- a/meowsum.c +++ b/meowsum.c @@ -19,7 +19,7 @@ #include#include <unistd.h> void print_usage() { - printf("usage: meowsum [OPTION]... [FILE]...\n"); + printf("usage: meowsum [OPTION]... FILE...\n"); printf("Print or check Meow hash checksums.\n"); printf("\n"); printf("When FILE is -, read standard input.\n");