summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2021-01-13 23:53:07 +0100
committerTimo Weingärtner <timo@tiwe.de>2021-01-14 00:07:29 +0100
commit36dbc5d061b39b22f2620ac0e0a137ea05dbad33 (patch)
treeba9aef7998a9041e7417f4c24b5b3b9308e5ad25
parent2cad5033359975238cbb95824595b638892bc039 (diff)
downloadhadori-36dbc5d061b39b22f2620ac0e0a137ea05dbad33.tar.gz
improve man page generation with help2man
-rw-r--r--Makefile4
-rw-r--r--hadori.C11
-rw-r--r--hadori.help2man13
3 files changed, 22 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index e8f40f6..959bb81 100644
--- a/Makefile
+++ b/Makefile
@@ -22,8 +22,8 @@ CPPFLAGS+=-D_FILE_OFFSET_BITS=64
all: hadori.1
-hadori.1: hadori
- help2man -n $< -o $@ -N ./$<
+%.1: %.help2man %
+ help2man -i $< -o $@ -N -L C.UTF-8 $(*D)/$(*F)
hadori: hadori.o
hadori.o: hadori.C version.h
diff --git a/hadori.C b/hadori.C
index 4465ef3..42a93df 100644
--- a/hadori.C
+++ b/hadori.C
@@ -202,7 +202,7 @@ static void recurse_start (std::string const & dir) {
}
int main (int const argc, char const * const * const argv) {
- po::options_description opts("OPTIONS");
+ po::options_description opts("Options");
opts.add_options()
("help,h", "print this help message")
("version,V", "print version information")
@@ -224,13 +224,16 @@ int main (int const argc, char const * const * const argv) {
po::notify(config);
if (config.count("help")) {
- std::cout << "Invocation: hadori [ OPTIONS ] [ ARGUMENTS ]" << std::endl;
- std::cout << opts << std::endl;
+ std::cout << "Usage: hadori [ OPTIONS ] [ ARGUMENTS ]\n";
+ std::cout << opts;
return EX_OK;
}
if (config.count("version")) {
- std::cout << HADORI_VERSION << std::endl;
+ std::cout << HADORI_VERSION "\n";
+ std::cout << "Written by Timo Weingärtner.\n";
+ std::cout << "Report bugs to the Debian BTS at https://bugs.debian.org/\n";
+ std::cout << "or by mail to timo@tiwe.de.\n";
return EX_OK;
}
diff --git a/hadori.help2man b/hadori.help2man
new file mode 100644
index 0000000..859dd2f
--- /dev/null
+++ b/hadori.help2man
@@ -0,0 +1,13 @@
+# roff markup for the list generated using "pandoc -t man" and pasted here
+[NAME]
+hadori \- hardlink identical files
+[DESCRIPTION]
+This might look like yet another hardlinking tool, but it is the only one which only memorizes one filename per inode. That results in less memory consumption and faster execution compared to its
+alternatives. Therefore (and because all the other names are already taken) it's called "HArdlinking DOne RIght".
+
+Advantages over other hardlinking tools:
+.IP \[bu] 2
+predictability: arguments are scanned in order, each first version is
+kept
+.IP \[bu] 2
+much lower CPU and memory consumption