From 50d11d401476fff9c1745e8d76dd0da0c4484422 Mon Sep 17 00:00:00 2001 From: zvezdochiot Date: Sun, 29 Jan 2023 23:09:19 +0300 Subject: [PATCH] 1.20: fix help, man and docs --- README.md | 4 +++- man/man1/torrentcheck.1 | 13 ++++++++----- src/torrentcheck.c | 18 ++++++++++++------ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 54b67d4..c2c5a17 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,11 @@ torrentcheck - catalog a `.torrent` file and optionally verify content hashes. -Usage: `torrentcheck torrent-file [-p content-path] [-n] [-h] [-c] [-d]` +Usage: `torrentcheck torrent-file [-p content-path] [-e] [-n] [-h] [-c] [-d]` Options: +`-p content-path` path of content data, +`-e str` encoding name (iconv), `-n` suppresses progress count, `-h` shows all hash values, `-c` or `-d` uses comma or dot formatted byte counts. diff --git a/man/man1/torrentcheck.1 b/man/man1/torrentcheck.1 index 3ff29de..f3fba9f 100644 --- a/man/man1/torrentcheck.1 +++ b/man/man1/torrentcheck.1 @@ -1,4 +1,4 @@ -.TH torrentcheck "1" "1.10" "07 Jan 2023" "User Manual" +.TH torrentcheck "1" "1.20" "29 Jan 2023" "User Manual" .SH NAME torrentcheck @@ -12,13 +12,16 @@ torrentcheck torrent-file [-p content-path] [-n] [-h] [-c] [-d] .SH OPTIONS .TP -p content-path -path of content data +path of content data, +.TP +-e str +encoding name (iconv), .TP -n -suppresses progress count +suppresses progress count, .TP -h -shows all hash values +shows all hash values, .TP -c or -d uses comma or dot formatted byte counts. @@ -39,7 +42,7 @@ torrentcheck my.torrent Mike Ingle .SH SEE ALSO -torreadwrite(1), ctorrent(1), aria2c(1) +torreadwrite(1), ctorrent(1), aria2c(1), iconv(1) .SH CONTACTS Website: https://github.com/ximellon/torrentcheck diff --git a/src/torrentcheck.c b/src/torrentcheck.c index 9ce35b2..f0af2de 100644 --- a/src/torrentcheck.c +++ b/src/torrentcheck.c @@ -16,6 +16,8 @@ #include #include +#define TORRENTCHECK_VERSION "1.2" + #ifdef ICONV_IMPLEMENTATION #include #endif @@ -532,16 +534,20 @@ int main(int argc,char* argv[]) if (torrentFile == NULL) { - printf("torrentcheck - catalog a .torrent file and optionally verify content hashes\n"); - printf("Usage: torrentcheck torrent-file [-p content-path] [-n] [-h] [-c] [-d]\n"); + printf("TorrentCheck version %s\n", TORRENTCHECK_VERSION); + printf("Catalog a .torrent file and optionally verify content hashes\n"); + printf("Usage:\n"); + printf("\ttorrentcheck torrent-file [-p content-path] [-e str] [-n] [-h] [-c] [-d]\n"); printf("Options:\n"); - printf("\t-n suppresses progress count,\n"); - printf("\t-h shows all hash values,\n"); - printf("\t-c or -d uses comma or dot formatted byte counts.\n"); + printf("\t-p content-path path of content data,\n"); + printf("\t-e str encoding name (iconv),\n"); + printf("\t-n suppresses progress count,\n"); + printf("\t-h shows all hash values,\n"); + printf("\t-c or -d uses comma or dot formatted byte counts.\n"); printf("Returns 0 if successful, nonzero return code if errors found.\n"); printf("\n"); printf("Option:\n"); - printf("\t-sha1 [optional hash] acts as a simple SHA1 filter.\n"); + printf("\t-sha1 [optional hash] acts as a simple SHA1 filter.\n"); printf("If -sha1 is followed by a hex hash, the return code will be zero\n"); printf("on match and nonzero otherwise.\n"); printf("\n");