bug-hello
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

man page generation nit-pick


From: Assaf Gordon
Subject: man page generation nit-pick
Date: Fri, 21 Mar 2014 13:11:08 -0400
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Hello,

A small nit-pick about the way man-pages are generated:

The command in "Makefile.am" is:
    hello.1: hello
        $(HELP2MAN) --include=$(top_srcdir)/man/hello.x $(top_builddir)/hello 
-o address@hidden

This means that the help is generated with:
    $(top_builddir)/hello --help
Which turns into:
    ./hello --help

The "usage()" in "./src/hello.c" uses the program_name just one (in the usage/synopsis), and 
"help2man" gets rid of the "./" prefix.
But had it used "program_name" again, such as in Coreutils's chown:
   http://lingrok.org/xref/coreutils/src/chown.c#144

Then the generated man page will have "./hello" instead of "hello".
It can be reproduced with this change:
  
https://github.com/agordon/gnuhello/commit/6266a95599ee90854f07b41b7ac2dcd5141c0196

My point is, if someone is using GNU-hello as a template, it might lead to 
incorrect man pages.
In "coreutils" this doesn't happen, but the man-page generation code is much 
more complicated.

A simple work-around could be to change "Makefile.am" to:
===
    hello.1: hello
        PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'$$PATH \
           $(HELP2MAN) --include=$(top_srcdir)/man/hello.x hello -o 
address@hidden
===


Regards,
 -gordon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]