From 36dbc5d061b39b22f2620ac0e0a137ea05dbad33 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Wed, 13 Jan 2021 23:53:07 +0100 Subject: improve man page generation with help2man --- Makefile | 4 ++-- hadori.C | 11 +++++++---- hadori.help2man | 13 +++++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 hadori.help2man 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 -- cgit v1.2.3