diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-23 12:22:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-23 12:22:19 +0200 |
commit | 7e9cb673ccfc77c5871292aa5491fc2c2dc2a663 (patch) | |
tree | ccb92fe421c895525be3a5c82429db8ea984775a /cli/source.cxx | |
parent | ccd0499c10b1ebf075bc251c4827ab79a6975165 (diff) |
Add --include-base-last option
Diffstat (limited to 'cli/source.cxx')
-rw-r--r-- | cli/source.cxx | 45 |
1 files changed, 22 insertions, 23 deletions
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 << "}"; } |