summaryrefslogtreecommitdiff
path: root/cli/source.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-01 16:43:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-01 16:43:18 +0200
commit957fd18c38e3bb1c9c489b40a0cbdf865e821294 (patch)
tree1e83341cb2d5407ce7733059da46aef3d6b70aeb /cli/source.cxx
parent60c5e99d211d0abc62c7cce7a52adb55c24e3a5d (diff)
Allow specification of argument documentation for flags
If all three documentation strings are specified for a bool option, then the usage, html, and man documentation will include the argument documentation (first string), just like for non-flag options. This is primarily useful for using options to handle commands where you may want to end up with something like "help [<options>] <command>".
Diffstat (limited to 'cli/source.cxx')
-rw-r--r--cli/source.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/source.cxx b/cli/source.cxx
index 7fb1391..2bf1c0f 100644
--- a/cli/source.cxx
+++ b/cli/source.cxx
@@ -203,7 +203,7 @@ namespace
string type (o.type ().name ());
- if (type != "bool")
+ if (type != "bool" || doc.size () >= 3)
{
l++; // ' ' seperator
@@ -260,7 +260,7 @@ namespace
string type (o.type ().name ());
- if (type != "bool")
+ if (type != "bool" || doc.size () >= 3)
{
os << ' ';
l++;
@@ -284,7 +284,7 @@ namespace
//
string d;
- if (type == "bool")
+ if (type == "bool" && doc.size () < 3)
{
if (doc.size () > 1)
d = doc[0];