From 2f0748bcb0c9f479f56b667ce9a6d1e495a1df80 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Sep 2015 14:39:22 +0200 Subject: Print common option summary for each command help --- bpkg/help.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bpkg/help.cxx') 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. -- cgit v1.1