Command line options and man pages

As one can generate man pages for a docbook refentry as well, it sounds like a good idea to use it for that purpose. This way the interface is part of the reference and one gets the man-page for free.

7.1.1. Document the tool

Create one refentry file per tool. Following our example we would call it meep/docs/reference/meeper/meep.xml. For the xml tags that should be used and can look at generated file in the xml subdirectory as well as examples e.g. in glib.

7.1.2. Adding the extra configure check

Example 7-1Extra configure checks
AC_ARG_ENABLE(man,
              [AC_HELP_STRING([--enable-man],
                              [regenerate man pages from Docbook [default=no]])],enable_man=yes,
              enable_man=no)

AC_PATH_PROG([XSLTPROC], [xsltproc])
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)

7.1.3. Adding the extra makefile rules

Example 7-2Extra configure checks
man_MANS = \
       meeper.1

if ENABLE_GTK_DOC
if ENABLE_MAN

%.1 : %.xml
        @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<

endif
endif

BUILT_EXTRA_DIST = $(man_MANS)
EXTRA_DIST += meep.xml