aboutsummaryrefslogtreecommitdiff
path: root/src/clients/appareo/man_appareo.cc
diff options
context:
space:
mode:
authorAvatar Ingmar Vanhassel <ingmar@exherbo.org> 2011-02-16 17:07:26 +0000
committerAvatar Ingmar Vanhassel <ingmar@exherbo.org> 2011-02-16 17:07:26 +0000
commit8e11571b026bc33a42f2a42065511d330fa13589 (patch)
tree9294ecd1e3c6876f392dfee24491815104f06957 /src/clients/appareo/man_appareo.cc
parente6d1c28fbc15ae287fc5641fe1d365bddd113b9f (diff)
downloadpaludis-8e11571b026bc33a42f2a42065511d330fa13589.tar.gz
paludis-8e11571b026bc33a42f2a42065511d330fa13589.tar.xz
Asciidocify appareo
Diffstat (limited to 'src/clients/appareo/man_appareo.cc')
-rw-r--r--src/clients/appareo/man_appareo.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/clients/appareo/man_appareo.cc b/src/clients/appareo/man_appareo.cc
index 26f379462..702a70a1b 100644
--- a/src/clients/appareo/man_appareo.cc
+++ b/src/clients/appareo/man_appareo.cc
@@ -19,6 +19,7 @@
#include "command_line.hh"
#include <paludis/args/man.hh>
+#include <paludis/args/do_help.hh>
#include <iostream>
#include <cstdlib>
@@ -32,10 +33,12 @@ namespace
paludis::args::ArgsHandler
{
paludis::args::ArgsGroup group;
+ paludis::args::SwitchArg a_asciidoc;
paludis::args::SwitchArg a_html;
ManCommandLine() :
group(main_options_section(), "", ""),
+ a_asciidoc(&group, "asciidoc", '\0', "", false),
a_html(&group, "html", '\0', "", false)
{
}
@@ -63,16 +66,15 @@ main(int argc, char * argv[])
ManCommandLine cmdline;
cmdline.run(argc, argv, "", "", "");
- if (cmdline.a_html.specified())
- {
- paludis::args::HtmlWriter hw(cout);
- paludis::args::generate_doc(hw, CommandLine::get_instance());
- }
+ std::shared_ptr<paludis::args::DocWriter> w;
+ if (cmdline.a_asciidoc.specified())
+ w = std::make_shared<paludis::args::AsciidocWriter>(cout);
+ else if (cmdline.a_html.specified())
+ w = std::make_shared<paludis::args::HtmlWriter>(cout);
else
- {
- paludis::args::ManWriter mw(cout);
- paludis::args::generate_doc(mw, CommandLine::get_instance());
- }
+ throw paludis::args::DoHelp("No format specified");
+
+ paludis::args::generate_doc(*w, CommandLine::get_instance());
return EXIT_SUCCESS;
}