From 0e56fe29a9afeee00e02e722496678df89d37d50 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Nov 2009 13:59:39 +0200 Subject: Complete the implementation of the option documentation Add the man page generator. Port CLI usage, HTML documentation and the man page to the auto-generated version. Update examples and documentation. --- examples/hello/driver.cxx | 7 +++---- examples/hello/hello.cli | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/hello/driver.cxx b/examples/hello/driver.cxx index b08e6be..bb82d22 100644 --- a/examples/hello/driver.cxx +++ b/examples/hello/driver.cxx @@ -12,10 +12,9 @@ using namespace std; void usage () { - cerr << "usage: driver " << endl - << " [--help]" << endl - << " [--greeting ]" << endl - << " [--exclamations ]" << endl; + cerr << "usage: driver [options] " << endl + << "options:" << endl; + options::print_usage (cerr); } int diff --git a/examples/hello/hello.cli b/examples/hello/hello.cli index 9907510..b75e1b8 100644 --- a/examples/hello/hello.cli +++ b/examples/hello/hello.cli @@ -2,7 +2,17 @@ include ; class options { - bool --help; - std::string --greeting = "Hello"; - unsigned int --exclamations = 1; + bool --help {"Print usage information and exit."}; + + std::string --greeting = "Hello" + { + "", + "Use as a greeting phrase instead of the default \"Hello\"." + }; + + unsigned int --exclamations = 1 + { + "", + "Print exclamation marks instead of 1 by default." + }; }; -- cgit v1.1