aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-04 14:39:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-04 14:39:22 +0200
commit2f0748bcb0c9f479f56b667ce9a6d1e495a1df80 (patch)
tree1f1a82a81fcbee64560c12f27ae67648ad389122
parent0e4d06919b7c075275b22edfc031f90b7f421e7a (diff)
Print common option summary for each command help
-rw-r--r--bpkg/help.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/bpkg/help.cxx b/bpkg/help.cxx
index e4cb963..0aad8f4 100644
--- a/bpkg/help.cxx
+++ b/bpkg/help.cxx
@@ -52,8 +52,20 @@ namespace bpkg
void
help (const help_options&, const string& t, void (*usage) (std::ostream&))
{
+ ostream& o (cout);
+
if (usage != nullptr) // Command.
- usage (cout);
+ {
+ usage (o);
+
+ o << endl
+ << "The common options are summarized below. For details, see the " <<
+ "'options' help" << endl
+ << "topic." << endl
+ << endl;
+
+ common_options::print_short_usage (o);
+ }
else if (t.empty ()) // General help.
help ();
else if (t == "options") // Help topics.