aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-27 02:07:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-27 02:07:38 +0000
commit17b2f8db16626eb819e13663dd36c8278ddff068 (patch)
treefba0763de125f1f4cc6bcd8fdbbc8a83145e0b55
parenta283fe406d5acb3d3f2729825a9271ffb06764e1 (diff)
downloadpaludis-17b2f8db16626eb819e13663dd36c8278ddff068.tar.gz
paludis-17b2f8db16626eb819e13663dd36c8278ddff068.tar.xz
Include HTML man pages. Fixes: ticket:46.
-rw-r--r--Makefile.am8
-rw-r--r--doc/Makefile.am46
-rw-r--r--doc/index.html.skel9
-rw-r--r--doc/man.html.skel17
-rw-r--r--paludis/args/man.cc208
-rw-r--r--paludis/args/man.hh23
-rw-r--r--src/clients/adjutrix/Makefile.am9
-rw-r--r--src/clients/adjutrix/command_line.cc13
-rw-r--r--src/clients/adjutrix/man_adjutrix.cc41
-rw-r--r--src/clients/contrarius/Makefile.am9
-rw-r--r--src/clients/contrarius/man_contrarius.cc42
-rw-r--r--src/clients/paludis/Makefile.am9
-rw-r--r--src/clients/paludis/man_paludis.cc43
-rw-r--r--src/clients/qualudis/Makefile.am8
-rw-r--r--src/clients/qualudis/man_qualudis.cc43
15 files changed, 463 insertions, 65 deletions
diff --git a/Makefile.am b/Makefile.am
index da884bb..96ab9bb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,10 +22,10 @@ automake-deps-dist-hack.tmp : built-sources-subdirs
$(MAKE) -C paludis/qa message-sr.hh
$(MAKE) -C src/output liboutput.a
$(MAKE) -C src/common_args libcommonargs.a
- $(MAKE) -C src/clients/paludis paludis.1
- $(MAKE) -C src/clients/qualudis qualudis.1
- $(MAKE) -C src/clients/contrarius contrarius.1
- $(MAKE) -C src/clients/adjutrix adjutrix.1
+ $(MAKE) -C src/clients/paludis paludis.1 paludis.html
+ $(MAKE) -C src/clients/qualudis qualudis.1 qualudis.html
+ $(MAKE) -C src/clients/contrarius contrarius.1 contrarius.html
+ $(MAKE) -C src/clients/adjutrix adjutrix.1 adjutrix.html
touch $@
dist-hook :
diff --git a/doc/Makefile.am b/doc/Makefile.am
index eabd11e..c77068f 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -28,18 +28,22 @@ htmlfiles = \
portagedifferences.html \
programmingwithpaludis.html \
sets.html \
- hooks.html
+ hooks.html \
+ man-paludis.html \
+ man-qualudis.html \
+ man-contrarius.html \
+ man-adjutrix.html
EXTRA_DIST = doxygen.conf.in header.html footer.html paludis.css \
$(docfiles) $(tagfiles) $(images) htaccess \
news.html.skel index.html.skel changelog.html.skel licence.html.skel authors.html.skel \
faq.html.skel htmlheader.html htmlfooter.html migration.html.skel cachefiles.html.skel \
configuration.html.skel portagedifferences.html.skel programmingwithpaludis.html.skel \
- sets.html.skel hooks.html.skel
+ sets.html.skel hooks.html.skel man.html.skel
CLEANFILES = *~ news.html index.html changelog.html licence.html authors.html faq.html \
migration.html cachefiles.html configuration.html portagedifferences.html programmingwithpaludis.html \
- sets.html hooks.html \
+ sets.html hooks.html man-paludis.html man-qualudis.html man-contrarius.html man-adjutrix.html \
cleannews cleanrecentnews cleanchangelog cleanauthors cleanfaqtoc cleanbasiccppapp cleanbasicrubyapp
MAINTAINERCLEANFILES = Makefile.in $(tagfiles)
@@ -238,6 +242,42 @@ licence.html : licence.html.skel htmlheader.html htmlfooter.html ../COPYING
-e '/@COPYING@/d' \
< $(srcdir)/licence.html.skel > licence.html
+man-adjutrix.html : $(top_builddir)/src/clients/adjutrix/adjutrix.html man.html.skel
+ sed -e '/@HEADER@/r htmlheader.html' \
+ -e '/@HEADER@/d' \
+ -e '/@FOOTER@/r htmlfooter.html' \
+ -e '/@FOOTER@/d' \
+ -e '/@MAN@/r $(top_builddir)/src/clients/adjutrix/adjutrix.html' \
+ -e '/@MAN@/d' \
+ < $(srcdir)/man.html.skel > man-adjutrix.html
+
+man-qualudis.html : $(top_builddir)/src/clients/qualudis/qualudis.html man.html.skel
+ sed -e '/@HEADER@/r htmlheader.html' \
+ -e '/@HEADER@/d' \
+ -e '/@FOOTER@/r htmlfooter.html' \
+ -e '/@FOOTER@/d' \
+ -e '/@MAN@/r $(top_builddir)/src/clients/qualudis/qualudis.html' \
+ -e '/@MAN@/d' \
+ < $(srcdir)/man.html.skel > man-qualudis.html
+
+man-paludis.html : $(top_builddir)/src/clients/paludis/paludis.html man.html.skel
+ sed -e '/@HEADER@/r htmlheader.html' \
+ -e '/@HEADER@/d' \
+ -e '/@FOOTER@/r htmlfooter.html' \
+ -e '/@FOOTER@/d' \
+ -e '/@MAN@/r $(top_builddir)/src/clients/paludis/paludis.html' \
+ -e '/@MAN@/d' \
+ < $(srcdir)/man.html.skel > man-paludis.html
+
+man-contrarius.html : $(top_builddir)/src/clients/contrarius/contrarius.html man.html.skel
+ sed -e '/@HEADER@/r htmlheader.html' \
+ -e '/@HEADER@/d' \
+ -e '/@FOOTER@/r htmlfooter.html' \
+ -e '/@FOOTER@/d' \
+ -e '/@MAN@/r $(top_builddir)/src/clients/contrarius/contrarius.html' \
+ -e '/@MAN@/d' \
+ < $(srcdir)/man.html.skel > man-contrarius.html
+
clean-local :
rm -fr www
diff --git a/doc/index.html.skel b/doc/index.html.skel
index 0e3f7e3..d09c739 100644
--- a/doc/index.html.skel
+++ b/doc/index.html.skel
@@ -52,6 +52,15 @@
href="http://trac.pioto.org:8000/paludis/">bug tracker</a> that can
be used for bug reports and feature requests.</li>
+ <li>Manual pages:
+ <ul>
+ <li><a href="man-adjutrix.html">adjutrix</a></li>
+ <li><a href="man-contrarius.html">contrarius</a></li>
+ <li><a href="man-paludis.html">paludis</a></li>
+ <li><a href="man-qualudis.html">qualudis</a></li>
+ </ul>
+ </li>
+
</ul>
<h2>For developers:</h2>
diff --git a/doc/man.html.skel b/doc/man.html.skel
new file mode 100644
index 0000000..7bb27e7
--- /dev/null
+++ b/doc/man.html.skel
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en" xml:lang="en">
+<head>
+<title>Paludis, the Other Package Mangler</title>
+<link rel="stylesheet" href="paludis.css" type="text/css" />
+</head>
+<body>
+@HEADER@
+
+@MAN@
+
+@FOOTER@
+</body>
+</html>
+
+
diff --git a/paludis/args/man.cc b/paludis/args/man.cc
index e802b63..0997eff 100644
--- a/paludis/args/man.cc
+++ b/paludis/args/man.cc
@@ -31,8 +31,10 @@ namespace
ArgsVisitorTypes::ConstVisitor
{
std::stringstream s;
+ ManFormat mf;
- ExtraText()
+ ExtraText(ManFormat m) :
+ mf(m)
{
}
@@ -58,14 +60,47 @@ namespace
void visit(const EnumArg * const e)
{
+ if (e->begin_allowed_args() == e->end_allowed_args())
+ return;
+
+ switch (mf)
+ {
+ case mf_man:
+ break;
+
+ case mf_html:
+ s << "<dl>" << endl;
+ break;
+ }
+
for (EnumArg::AllowedArgIterator a(e->begin_allowed_args()), a_end(e->end_allowed_args()) ;
a != a_end ; ++a)
{
- s << ".RS" << endl;
- s << ".TP" << endl;
- s << ".B \"" << a->first << "\"" << endl;
- s << a->second << endl;
- s << ".RE" << endl;
+ switch (mf)
+ {
+ case mf_man:
+ s << ".RS" << endl;
+ s << ".TP" << endl;
+ s << ".B \"" << a->first << "\"" << endl;
+ s << a->second << endl;
+ s << ".RE" << endl;
+ break;
+
+ case mf_html:
+ s << "<dt>" << a->first << "</dt>" << endl;
+ s << "<dd>" << a->second << "</dd>" << endl;
+ break;
+ }
+ }
+
+ switch (mf)
+ {
+ case mf_man:
+ break;
+
+ case mf_html:
+ s << "</dl>" << endl;
+ break;
}
}
@@ -95,59 +130,168 @@ namespace
void
paludis::args::generate_man(std::ostream & f, const ArgsHandler * const h)
{
- f << ".TH \"" << h->app_name() << "\" "
- << h->man_section() << endl;
+ generate_man(f, h, mf_man);
+}
- f << ".SH NAME" << endl;
- f << h->app_name() << " \\- "
- << h->app_synopsis() << endl;
+void
+paludis::args::generate_man(std::ostream & f, const ArgsHandler * const h,
+ const ManFormat mf)
+{
+ switch (mf)
+ {
+ case mf_man:
+ f << ".TH \"" << h->app_name() << "\" " << h->man_section() << endl;
+ f << ".SH NAME" << endl;
+ f << h->app_name() << " \\- " << h->app_synopsis() << endl;
+ f << ".SH SYNOPSIS" << endl;
+ break;
- f << ".SH SYNOPSIS" << endl;
+ case mf_html:
+ f << "<h1>" << h->app_name() << "(" << h->man_section() << ")" << "</h1>" << endl;
+ f << "<h2>Name</h2>" << endl;
+ f << "<p>" << h->app_name() << " - " << h->app_synopsis() << "</p>" << endl;
+ f << "<h2>Synopsis</h2>" << endl;
+ break;
+ }
for (ArgsHandler::UsageLineIterator u(h->begin_usage_lines()),
u_end(h->end_usage_lines()) ; u != u_end ; ++u)
- f << ".B " << h->app_name() << " " << *u << endl << endl;
+ {
+ switch (mf)
+ {
+ case mf_man:
+ f << ".B " << h->app_name() << " " << *u << endl << endl;
+ break;
+
+ case mf_html:
+ f << "<p>" << h->app_name() << " " << *u << "</p>" << endl;
+ break;
+ }
+ }
- f << ".SH DESCRIPTION" << endl;
- f << h->app_description() << endl;
+ switch (mf)
+ {
+ case mf_man:
+ f << ".SH DESCRIPTION" << endl;
+ f << h->app_description() << endl;
+ f << ".SH OPTIONS" << endl;
+ break;
- f << ".SH OPTIONS" << endl;
+ case mf_html:
+ f << "<h2>Description</h2>" << endl;
+ f << "<p>" << h->app_description() << "</p>" << endl;
+ f << "<h2>Options</h2>" << endl;
+ break;
+ }
for (ArgsHandler::ArgsGroupsIterator a(h->begin_args_groups()),
a_end(h->end_args_groups()) ; a != a_end ; ++a)
{
- f << ".SS \"" << (*a)->name() << "\"" << endl;
- f << (*a)->description() << endl;
+ switch (mf)
+ {
+ case mf_man:
+ f << ".SS \"" << (*a)->name() << "\"" << endl;
+ f << (*a)->description() << endl;
+ break;
+
+ case mf_html:
+ f << "<h3>" << (*a)->name() << "</h3>" << endl;
+ f << "<p>" << (*a)->description() << "</p>" << endl;
+ f << "<dl>";
+ break;
+ }
for (paludis::args::ArgsGroup::Iterator b((*a)->begin()), b_end((*a)->end()) ;
b != b_end ; ++b)
{
- f << ".TP" << endl;
- f << ".B \"";
- if ((*b)->short_name())
- f << "\\-" << (*b)->short_name() << " , ";
- f << "\\-\\-" << (*b)->long_name() << "\"" << endl;
- f << (*b)->description() << endl;
-
- ExtraText t;
+ switch (mf)
+ {
+ case mf_man:
+ f << ".TP" << endl;
+ f << ".B \"";
+ if ((*b)->short_name())
+ f << "\\-" << (*b)->short_name() << " , ";
+ f << "\\-\\-" << (*b)->long_name() << "\"" << endl;
+ f << (*b)->description() << endl;
+ break;
+
+ case mf_html:
+ f << "<dt>";
+ if ((*b)->short_name())
+ f << "-" << (*b)->short_name() << ", ";
+ f << "--" << (*b)->long_name() << "</dt>" << endl;
+ f << "<dd>" << (*b)->description() << endl;
+
+ break;
+ }
+
+ ExtraText t(mf);
(*b)->accept(&t);
f << t;
+
+ switch (mf)
+ {
+ case mf_man:
+ break;
+
+ case mf_html:
+ f << "</dd>" << endl;
+ break;
+ }
+ }
+
+ switch (mf)
+ {
+ case mf_man:
+ break;
+
+ case mf_html:
+ f << "</dl>";
+ break;
}
}
- if (h->begin_environment_lines() !=
- h->end_environment_lines())
+ if (h->begin_environment_lines() != h->end_environment_lines())
{
- f << ".SH ENVIRONMENT" << endl;
+ switch (mf)
+ {
+ case mf_man:
+ f << ".SH ENVIRONMENT" << endl;
+ break;
+
+ case mf_html:
+ f << "<h2>Environment</h2>" << endl;
+ f << "<dl>" << endl;
+ break;
+ }
for (ArgsHandler::EnvironmentLineIterator a(h->begin_environment_lines()),
a_end(h->end_environment_lines()) ; a != a_end ; ++a)
{
- f << ".TP" << endl;
- f << ".B \"" << a->first << "\"" << endl;
- f << a->second << endl;
+ switch (mf)
+ {
+ case mf_man:
+ f << ".TP" << endl;
+ f << ".B \"" << a->first << "\"" << endl;
+ f << a->second << endl;
+ break;
+
+ case mf_html:
+ f << "<dt>" << a->first << "</dt>" << endl;
+ f << "<dd>" << a->second << "</dd>" << endl;
+ break;
+ }
}
+ switch (mf)
+ {
+ case mf_man:
+ break;
+
+ case mf_html:
+ f << "</dl>" << endl;
+ break;
+ }
}
}
diff --git a/paludis/args/man.hh b/paludis/args/man.hh
index 220707e..356d4ce 100644
--- a/paludis/args/man.hh
+++ b/paludis/args/man.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,9 +28,28 @@ namespace paludis
namespace args
{
/**
+ * Format for generate_man.
+ */
+ enum ManFormat
+ {
+ mf_man,
+ mf_html
+ };
+
+ /**
+ * Write a man page to an ostream.
+ *
+ * \deprecated Use the three arg form.
+ */
+ void generate_man(std::ostream &, const ArgsHandler * const h) PALUDIS_VISIBLE
+ PALUDIS_ATTRIBUTE((deprecated));
+
+ /**
* Write a man page to an ostream.
+ *
+ * \deprecated Use the three arg form.
*/
- void generate_man(std::ostream &, const ArgsHandler * const h) PALUDIS_VISIBLE;
+ void generate_man(std::ostream &, const ArgsHandler * const h, const ManFormat) PALUDIS_VISIBLE;
}
}
diff --git a/src/clients/adjutrix/Makefile.am b/src/clients/adjutrix/Makefile.am
index a80bdec..1bae52e 100644
--- a/src/clients/adjutrix/Makefile.am
+++ b/src/clients/adjutrix/Makefile.am
@@ -9,11 +9,15 @@ SUBDIRS = .
bin_PROGRAMS = adjutrix
noinst_PROGRAMS = man-adjutrix
+noinst_DATA = adjutrix.html
man_MANS = adjutrix.1
adjutrix.1 : man-adjutrix
- ./man-adjutrix | tee $@ | sed -e 's/^/ /'
+ ./man-adjutrix > $@
+
+adjutrix.html : man-adjutrix
+ ./man-adjutrix --html > $@
man_adjutrix_SOURCES = \
man_adjutrix.cc \
@@ -73,7 +77,8 @@ EXTRA_DIST = \
find_stable_candidates_TEST_setup.sh find_stable_candidates_TEST_cleanup.sh
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
-DISTCLEANFILES = $(man_MANS) find_stable_candidates-sr.hh find_stable_candidates-sr.cc
+DISTCLEANFILES = $(man_MANS) $(noinst_DATA) \
+ find_stable_candidates-sr.hh find_stable_candidates-sr.cc
MAINTAINERCLEANFILES = Makefile.in
BUILT_SOURCES = \
find_stable_candidates-sr.hh find_stable_candidates-sr.cc \
diff --git a/src/clients/adjutrix/command_line.cc b/src/clients/adjutrix/command_line.cc
index abe52c8..b5f05e6 100644
--- a/src/clients/adjutrix/command_line.cc
+++ b/src/clients/adjutrix/command_line.cc
@@ -97,11 +97,24 @@ CommandLine::CommandLine() :
add_usage_line("--find-insecure-packages [ --repository-dir /path ] "
"[ --category app-misc --category sys-apps ... ] "
"[ --package foo --package fnord ... ] ");
+ add_usage_line("--find-unused-packages [ --repository-dir /path ] "
+ "[ --category app-misc --category sys-apps ... ] "
+ "[ --package foo --package fnord ... ] ");
add_usage_line("--keywords-graph [ --repository-dir /path ] "
"[ --category app-misc --category sys-apps ... ] "
"[ --package foo --package fnord ... ]");
+ add_usage_line("--reverse-deps [ --repository-dir /path ] "
+ "[ --category app-misc --category sys-apps ... ] "
+ "[ --package foo --package fnord ... ]"
+ "target-atom");
+ add_usage_line("--what-needs-keywording [ --repository-dir /path ] "
+ "[ --category app-misc --category sys-apps ... ] "
+ "[ --package foo --package fnord ... ]"
+ "target-keyword target-atom");
add_usage_line("--display-profiles-use [ --profile default-linux/x86/2006.0 "
"--profile default-linux/x86/2006.1 ... ] [ --repository-dir /path ]");
+ add_usage_line("--display-default-system-resolution [ --profile default-linux/x86/2006.0 "
+ "--profile default-linux/x86/2006.1 ... ] [ --repository-dir /path ]");
add_usage_line("--version");
add_usage_line("--help");
diff --git a/src/clients/adjutrix/man_adjutrix.cc b/src/clients/adjutrix/man_adjutrix.cc
index d36aa1d..7fcd244 100644
--- a/src/clients/adjutrix/man_adjutrix.cc
+++ b/src/clients/adjutrix/man_adjutrix.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -26,10 +26,45 @@
using std::cout;
using std::endl;
+namespace
+{
+ struct ManCommandLine :
+ paludis::args::ArgsHandler
+ {
+ paludis::args::ArgsGroup group;
+ paludis::args::SwitchArg a_html;
+
+ ManCommandLine() :
+ group(this, "", ""),
+ a_html(&group, "html", '\0', "")
+ {
+ }
+
+ virtual std::string app_name() const
+ {
+ return "";
+ }
+
+ virtual std::string app_description() const
+ {
+ return "";
+ }
+
+ virtual std::string app_synopsis() const
+ {
+ return "";
+ }
+ };
+}
+
int
-main(int, char *[])
+main(int argc, char * argv[])
{
- paludis::args::generate_man(cout, CommandLine::get_instance());
+ ManCommandLine cmdline;
+ cmdline.run(argc, argv, "", "", "");
+
+ paludis::args::generate_man(cout, CommandLine::get_instance(),
+ cmdline.a_html.specified() ? paludis::args::mf_html : paludis::args::mf_man);
return EXIT_SUCCESS;
}
diff --git a/src/clients/contrarius/Makefile.am b/src/clients/contrarius/Makefile.am
index e4dc69e..beb5953 100644
--- a/src/clients/contrarius/Makefile.am
+++ b/src/clients/contrarius/Makefile.am
@@ -10,6 +10,7 @@ man_pages = contrarius.1
bin_PROGRAMS = contrarius
noinst_PROGRAMS = man-contrarius
+noinst_DATA = contrarius.html
man_MANS = $(man_pages)
contrarius_SOURCES = \
@@ -55,7 +56,10 @@ version_TEST :
echo -e "#!/bin/sh\n./contrarius --version" > $@
contrarius.1 : man-contrarius
- ./man-contrarius | tee $@ | sed -e 's/^/ /'
+ ./man-contrarius > $@
+
+contrarius.html : man-contrarius
+ ./man-contrarius --html > $@
man_contrarius_SOURCES = \
man_contrarius.cc \
@@ -70,7 +74,8 @@ man_contrarius_LDADD = \
$(DYNAMIC_LD_LIBS)
CLEANFILES = *~ version_TEST gmon.out *.gcov *.gcno *.gcda
-DISTCLEANFILES = $(man_pages) contrarius_stage_options-sr.hh contrarius_stage_options-sr.cc
+DISTCLEANFILES = $(man_pages) $(noinst_DATA) \
+ contrarius_stage_options-sr.hh contrarius_stage_options-sr.cc
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = \
$(man_pages) \
diff --git a/src/clients/contrarius/man_contrarius.cc b/src/clients/contrarius/man_contrarius.cc
index 89c480e..d8e16f4 100644
--- a/src/clients/contrarius/man_contrarius.cc
+++ b/src/clients/contrarius/man_contrarius.cc
@@ -2,6 +2,7 @@
/*
* Copyright (c) 2006 Danny van Dyk <kugelfang@gentoo.org>
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -19,7 +20,6 @@
#include "command_line.hh"
#include <paludis/args/man.hh>
-#include "config.h"
#include <iostream>
#include <cstdlib>
@@ -27,11 +27,45 @@
using std::cout;
using std::endl;
+namespace
+{
+ struct ManCommandLine :
+ paludis::args::ArgsHandler
+ {
+ paludis::args::ArgsGroup group;
+ paludis::args::SwitchArg a_html;
+
+ ManCommandLine() :
+ group(this, "", ""),
+ a_html(&group, "html", '\0', "")
+ {
+ }
+
+ virtual std::string app_name() const
+ {
+ return "";
+ }
+
+ virtual std::string app_description() const
+ {
+ return "";
+ }
+
+ virtual std::string app_synopsis() const
+ {
+ return "";
+ }
+ };
+}
+
int
-main(int, char *[])
+main(int argc, char * argv[])
{
- paludis::args::generate_man(cout, CommandLine::get_instance());
+ ManCommandLine cmdline;
+ cmdline.run(argc, argv, "", "", "");
+
+ paludis::args::generate_man(cout, CommandLine::get_instance(),
+ cmdline.a_html.specified() ? paludis::args::mf_html : paludis::args::mf_man);
return EXIT_SUCCESS;
}
-
diff --git a/src/clients/paludis/Makefile.am b/src/clients/paludis/Makefile.am
index 7aa62da..f0338e8 100644
--- a/src/clients/paludis/Makefile.am
+++ b/src/clients/paludis/Makefile.am
@@ -9,11 +9,14 @@ SUBDIRS = .
bin_PROGRAMS = paludis
noinst_PROGRAMS = man-paludis
-
+noinst_DATA = paludis.html
man_MANS = paludis.1
paludis.1 : man-paludis
- ./man-paludis | tee $@ | sed -e 's/^/ /'
+ ./man-paludis > $@
+
+paludis.html : man-paludis
+ ./man-paludis --html > $@
man_paludis_SOURCES = \
man_paludis.cc \
@@ -92,7 +95,7 @@ EXTRA_DIST = \
upgrade_TEST_setup.sh upgrade_TEST_cleanup.sh
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
-DISTCLEANFILES = $(man_MANS)
+DISTCLEANFILES = $(man_MANS) $(noinst_DATA)
MAINTAINERCLEANFILES = Makefile.in
built-sources : $(BUILT_SOURCES)
diff --git a/src/clients/paludis/man_paludis.cc b/src/clients/paludis/man_paludis.cc
index 9cab7e5..2bc3b97 100644
--- a/src/clients/paludis/man_paludis.cc
+++ b/src/clients/paludis/man_paludis.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -26,10 +26,47 @@
using std::cout;
using std::endl;
+namespace
+{
+ struct ManCommandLine :
+ paludis::args::ArgsHandler
+ {
+ paludis::args::ArgsGroup group;
+ paludis::args::SwitchArg a_html;
+
+ ManCommandLine() :
+ group(this, "", ""),
+ a_html(&group, "html", '\0', "")
+ {
+ }
+
+ virtual std::string app_name() const
+ {
+ return "";
+ }
+
+ virtual std::string app_description() const
+ {
+ return "";
+ }
+
+ virtual std::string app_synopsis() const
+ {
+ return "";
+ }
+ };
+}
+
int
-main(int, char *[])
+main(int argc, char * argv[])
{
- paludis::args::generate_man(cout, CommandLine::get_instance());
+ ManCommandLine cmdline;
+ cmdline.run(argc, argv, "", "", "");
+
+ paludis::args::generate_man(cout, CommandLine::get_instance(),
+ cmdline.a_html.specified() ? paludis::args::mf_html : paludis::args::mf_man);
return EXIT_SUCCESS;
}
+
+
diff --git a/src/clients/qualudis/Makefile.am b/src/clients/qualudis/Makefile.am
index 361ec04..6cce4c0 100644
--- a/src/clients/qualudis/Makefile.am
+++ b/src/clients/qualudis/Makefile.am
@@ -6,6 +6,7 @@ DEFS= \
SUBDIRS = .
man_pages = qualudis.1
+noinst_DATA = qualudis.html
if ENABLE_QA
@@ -64,7 +65,10 @@ version_TEST :
endif
qualudis.1 : man-qualudis
- ./man-qualudis | tee $@ | sed -e 's/^/ /'
+ ./man-qualudis > $@
+
+qualudis.html : man-qualudis
+ ./man-qualudis --html > $@
man_qualudis_SOURCES = \
man_qualudis.cc \
@@ -79,7 +83,7 @@ man_qualudis_LDADD = \
$(DYNAMIC_LD_LIBS)
CLEANFILES = *~ version_TEST gmon.out *.gcov *.gcno *.gcda
-DISTCLEANFILES = $(man_pages)
+DISTCLEANFILES = $(man_pages) $(noinst_DATA)
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = $(man_pages)
diff --git a/src/clients/qualudis/man_qualudis.cc b/src/clients/qualudis/man_qualudis.cc
index 4f0f1f8..01d4947 100644
--- a/src/clients/qualudis/man_qualudis.cc
+++ b/src/clients/qualudis/man_qualudis.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -19,7 +19,6 @@
#include "qualudis_command_line.hh"
#include <paludis/args/man.hh>
-#include "config.h"
#include <iostream>
#include <cstdlib>
@@ -27,11 +26,45 @@
using std::cout;
using std::endl;
+namespace
+{
+ struct ManCommandLine :
+ paludis::args::ArgsHandler
+ {
+ paludis::args::ArgsGroup group;
+ paludis::args::SwitchArg a_html;
+
+ ManCommandLine() :
+ group(this, "", ""),
+ a_html(&group, "html", '\0', "")
+ {
+ }
+
+ virtual std::string app_name() const
+ {
+ return "";
+ }
+
+ virtual std::string app_description() const
+ {
+ return "";
+ }
+
+ virtual std::string app_synopsis() const
+ {
+ return "";
+ }
+ };
+}
+
int
-main(int, char *[])
+main(int argc, char * argv[])
{
- paludis::args::generate_man(cout, QualudisCommandLine::get_instance());
+ ManCommandLine cmdline;
+ cmdline.run(argc, argv, "", "", "");
+
+ paludis::args::generate_man(cout, QualudisCommandLine::get_instance(),
+ cmdline.a_html.specified() ? paludis::args::mf_html : paludis::args::mf_man);
return EXIT_SUCCESS;
}
-