summaryrefslogtreecommitdiff
path: root/cli/header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-02 15:18:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-02 15:18:11 +0200
commit2eb28736a05c7083f2b30b501954a789bbd85f88 (patch)
tree9cd38c69d7ce26d45e4180f1cca8808f54309f7f /cli/header.cxx
parent957fd18c38e3bb1c9c489b40a0cbdf865e821294 (diff)
Add --short-usage option
When combined with --long-usage, it makes CLI generate both short and long usage printing code.
Diffstat (limited to 'cli/header.cxx')
-rw-r--r--cli/header.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/cli/header.cxx b/cli/header.cxx
index 26c23b8..ddf0895 100644
--- a/cli/header.cxx
+++ b/cli/header.cxx
@@ -179,13 +179,22 @@ namespace
// Usage.
//
- if (usage)
+ if (usage != ut_none)
{
os << "// Print usage information." << endl
- << "//" << endl
- << "static void" << endl
- << "print_usage (" << options.ostream_type () << "&);"
- << endl;
+ << "//" << endl;
+
+ if (usage != ut_both)
+ os << "static void" << endl
+ << "print_usage (" << options.ostream_type () << "&);"
+ << endl;
+ else
+ os << "static void" << endl
+ << "print_short_usage (" << options.ostream_type () << "&);"
+ << endl
+ << "static void" << endl
+ << "print_long_usage (" << options.ostream_type () << "&);"
+ << endl;
}
// Description.