From 7e9cb673ccfc77c5871292aa5491fc2c2dc2a663 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Nov 2015 12:22:19 +0200 Subject: Add --include-base-last option --- cli/source.cxx | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'cli/source.cxx') diff --git a/cli/source.cxx b/cli/source.cxx index 2113034..29f671e 100644 --- a/cli/source.cxx +++ b/cli/source.cxx @@ -751,22 +751,21 @@ namespace << "print_usage (" << options.ostream_type () << "&" << (len != 0 || b ? " os)" : ")") << "{"; - - // Call our bases. - // - if (b) { - base_usage t (*this, usage == ut_both ? ut_short : usage); - traversal::inherits i (t); - inherits (c, i); - } + base_usage bu (*this, usage == ut_both ? ut_short : usage); + traversal::inherits i (bu); - // Print option usage. - // - { - option_usage t (*this, len, usage == ut_both ? ut_short : usage); - traversal::names n (t); + if (b && !options.include_base_last ()) + inherits (c, i); + + // Print option usage. + // + option_usage ou (*this, len, usage == ut_both ? ut_short : usage); + traversal::names n (ou); names (c, n); + + if (b && options.include_base_last ()) + inherits (c, i); } os << "}"; @@ -780,18 +779,18 @@ namespace options.ostream_type () << "&" << (len != 0 || b ? " os)" : ")") << "{"; - if (b) - { - base_usage t (*this, ut_long); - traversal::inherits i (t); + base_usage bu (*this, ut_long); + traversal::inherits i (bu); + + if (b && !options.include_base_last ()) inherits (c, i); - } - { - option_usage t (*this, len, ut_long); - traversal::names n (t); - names (c, n); - } + option_usage ou (*this, len, ut_long); + traversal::names n (ou); + names (c, n); + + if (b && options.include_base_last ()) + inherits (c, i); os << "}"; } -- cgit v1.1