aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-10 20:01:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-10 20:01:26 +0000
commit4fe26c26ad394eb3a056cd30423196eca1ab02c3 (patch)
tree747c866a696d9655e1a08d2bdd75843a151feb61
parentd1a64b0b441552842f9627843df2fc9ada84c825 (diff)
downloadpaludis-4fe26c26ad394eb3a056cd30423196eca1ab02c3.tar.gz
paludis-4fe26c26ad394eb3a056cd30423196eca1ab02c3.tar.xz
Fix man html generation. Fixes: ticket:133
-rw-r--r--paludis/args/man.cc46
1 files changed, 39 insertions, 7 deletions
diff --git a/paludis/args/man.cc b/paludis/args/man.cc
index 0997eff..97cb5cd 100644
--- a/paludis/args/man.cc
+++ b/paludis/args/man.cc
@@ -106,15 +106,47 @@ namespace
void visit(const StringSetArg * const e)
{
- for (StringSetArg::AllowedArgIterator a(e->begin_allowed_args()), a_end(e->end_allowed_args()) ;
+ 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 << ".BR" << 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;
}
}
};