summaryrefslogtreecommitdiff
path: root/cli/header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-19 10:12:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-19 10:12:22 +0200
commit0b4fcbeae101f2a5171217f65bab9c6545e853ba (patch)
treed4a80d33799ba874c8ab4ff26185a9bccce9b6ce /cli/header.cxx
parent89ce153311d9163bbc356927346c0b30e158a75f (diff)
Add option description that can be examined at runtime.
New option: --generate-description.
Diffstat (limited to 'cli/header.cxx')
-rw-r--r--cli/header.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/cli/header.cxx b/cli/header.cxx
index 7905b22..d1b078f 100644
--- a/cli/header.cxx
+++ b/cli/header.cxx
@@ -135,7 +135,7 @@ namespace
names (c, names_option_);
- // usage
+ // Usage.
//
if (usage)
{
@@ -146,6 +146,17 @@ namespace
<< endl;
}
+ // Description.
+ //
+ if (options.generate_description ())
+ {
+ os << "// Option description." << endl
+ << "//" << endl
+ << "static const " << cli << "::options&" << endl
+ << "description ();"
+ << endl;
+ }
+
// _parse()
//
os << "private:" << endl