diff options
| author | Boris Kolpackov <boris@codesynthesis.com> | 2012-05-11 09:49:05 +0200 |
|---|---|---|
| committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-05-11 09:49:05 +0200 |
| commit | 0a1c72f32cd709972d6e4e5591dfd05d91edc8e1 (patch) | |
| tree | 96b21cc79478be206d84b8e704e35264d48bffc9 /cli | |
| parent | 443293aaf09eca7c3b88d621d056c4effee2c248 (diff) | |
| download | cli-0a1c72f32cd709972d6e4e5591dfd05d91edc8e1.tar.gz cli-0a1c72f32cd709972d6e4e5591dfd05d91edc8e1.tar.xz cli-0a1c72f32cd709972d6e4e5591dfd05d91edc8e1.zip | |
Avoid unused variable warning for empty option classes
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/source.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/source.cxx b/cli/source.cxx index d49caf8..2b976d4 100644 --- a/cli/source.cxx +++ b/cli/source.cxx @@ -612,10 +612,6 @@ namespace { bool b (hb && !options.exclude_base ()); - os << "void " << name << "::" << endl - << "print_usage (::std::ostream&" << (ho || b ? " os" : "") << ")" - << "{"; - // Calculate option length. // size_t len (0); @@ -676,7 +672,7 @@ namespace } } - if (max != 0) + if (len != 0 && max != 0) { if (len > max) { @@ -690,6 +686,12 @@ namespace } } + // If len is 0 then it means we have no options to print. + // + os << "void " << name << "::" << endl + << "print_usage (::std::ostream&" << (len != 0 || b ? " os)" : ")") + << "{"; + // Call our bases. // if (b) |
