From: wolf Date: Tue, 13 Jan 2004 20:36:59 +0000 (+0000) Subject: Fix a couple of thinkos with my previous patch. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9e479a4ea412ea0acdf4805f472b37ac7b91ccf;p=dealii-svn.git Fix a couple of thinkos with my previous patch. git-svn-id: https://svn.dealii.org/trunk@8315 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/parameter_handler.cc b/deal.II/base/source/parameter_handler.cc index 05203e5eab..e65eb980c5 100644 --- a/deal.II/base/source/parameter_handler.cc +++ b/deal.II/base/source/parameter_handler.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -907,9 +907,17 @@ ParameterHandler::print_parameters_section (std::ostream &out, << "set " << ptr->first << std::setw(longest_name-ptr->first.length()+1) << " " - << "= " << value - << std::setw(longest_value-value.length()+1) << " " - << "# "; + << "= " << value; + + // if we are going to write some + // text after this, then add a + // comment marker and align it + // properly + if ((pd->entries[ptr->first].documentation.length() != 0) + || + (value != pd->entries[ptr->first].value)) + out << std::setw(longest_value-value.length()+1) << " " + << "# "; // if there is // documentation, then @@ -918,15 +926,21 @@ ParameterHandler::print_parameters_section (std::ostream &out, // always looked up in // the Defaults tree if (pd->entries[ptr->first].documentation.length() != 0) - out << pd->entries[ptr->first].documentation << ", "; + out << pd->entries[ptr->first].documentation; // finally print the // default value, but // only if it differs // from the actual value if (value != pd->entries[ptr->first].value) - out << "default: " << pd->entries[ptr->first].value - << std::endl; + { + if (pd->entries[ptr->first].documentation.length() != 0) + out << ", "; + + out << "default: " << pd->entries[ptr->first].value; + } + + out << std::endl; } break; diff --git a/tests/results/i686-pc-linux-gnu+gcc2.95/bits/parameter_handler_3.output b/tests/results/i686-pc-linux-gnu+gcc2.95/bits/parameter_handler_3.output index fb961fe6d3..05c55a117f 100644 --- a/tests/results/i686-pc-linux-gnu+gcc2.95/bits/parameter_handler_3.output +++ b/tests/results/i686-pc-linux-gnu+gcc2.95/bits/parameter_handler_3.output @@ -2,7 +2,7 @@ # Listing of Parameters # --------------------- subsection Testing - set double = 3.1415926 # docs 3, default: 3.1415926 + set double = 3.1415926 # docs 3 set int = 3 # default: 1 set string list = a, b, c # docs 1, default: a end diff --git a/tests/results/i686-pc-linux-gnu+gcc2.95/bits/parameter_handler_5.output b/tests/results/i686-pc-linux-gnu+gcc2.95/bits/parameter_handler_5.output index e4615b4b2e..9f83022ba0 100644 --- a/tests/results/i686-pc-linux-gnu+gcc2.95/bits/parameter_handler_5.output +++ b/tests/results/i686-pc-linux-gnu+gcc2.95/bits/parameter_handler_5.output @@ -1,4 +1,4 @@ # Listing of Parameters # --------------------- -set int = 2 # default: 2 +set int = 2 diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/parameter_handler_3.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/parameter_handler_3.output index fb961fe6d3..05c55a117f 100644 --- a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/parameter_handler_3.output +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/parameter_handler_3.output @@ -2,7 +2,7 @@ # Listing of Parameters # --------------------- subsection Testing - set double = 3.1415926 # docs 3, default: 3.1415926 + set double = 3.1415926 # docs 3 set int = 3 # default: 1 set string list = a, b, c # docs 1, default: a end diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/parameter_handler_5.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/parameter_handler_5.output index e4615b4b2e..9f83022ba0 100644 --- a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/parameter_handler_5.output +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/parameter_handler_5.output @@ -1,4 +1,4 @@ # Listing of Parameters # --------------------- -set int = 2 # default: 2 +set int = 2 diff --git a/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/parameter_handler_3.output b/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/parameter_handler_3.output index fb961fe6d3..05c55a117f 100644 --- a/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/parameter_handler_3.output +++ b/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/parameter_handler_3.output @@ -2,7 +2,7 @@ # Listing of Parameters # --------------------- subsection Testing - set double = 3.1415926 # docs 3, default: 3.1415926 + set double = 3.1415926 # docs 3 set int = 3 # default: 1 set string list = a, b, c # docs 1, default: a end diff --git a/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/parameter_handler_5.output b/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/parameter_handler_5.output index e4615b4b2e..9f83022ba0 100644 --- a/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/parameter_handler_5.output +++ b/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/parameter_handler_5.output @@ -1,4 +1,4 @@ # Listing of Parameters # --------------------- -set int = 2 # default: 2 +set int = 2