From 2eb28736a05c7083f2b30b501954a789bbd85f88 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Sep 2015 15:18:11 +0200 Subject: Add --short-usage option When combined with --long-usage, it makes CLI generate both short and long usage printing code. --- cli/header.cxx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'cli/header.cxx') 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. -- cgit v1.1