]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a couple of thinkos with my previous patch.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 13 Jan 2004 20:36:59 +0000 (20:36 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 13 Jan 2004 20:36:59 +0000 (20:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@8315 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/parameter_handler.cc

index 05203e5eab22e551fafd354fbfe99726e93b40ed..e65eb980c586be3873ebaa569b99ff241be5c5cc 100644 (file)
@@ -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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.