[cig-commits] r14410 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Sat Mar 21 09:57:42 PDT 2009


Author: luis
Date: 2009-03-21 09:57:41 -0700 (Sat, 21 Mar 2009)
New Revision: 14410

Modified:
   cs/cigma/trunk/src/cli_compare_cmd.cpp
Log:
Specifying --timer-frequency now implies --verbose

Modified: cs/cigma/trunk/src/cli_compare_cmd.cpp
===================================================================
--- cs/cigma/trunk/src/cli_compare_cmd.cpp	2009-03-21 00:36:39 UTC (rev 14409)
+++ cs/cigma/trunk/src/cli_compare_cmd.cpp	2009-03-21 16:57:41 UTC (rev 14410)
@@ -69,7 +69,7 @@
         ;
 
     other.add_options()
-        ("quiet", "suppress all output")
+        ("quiet,q", "suppress all output")
         ;
 
     hidden.add_options()
@@ -115,22 +115,31 @@
         }
     }
 
-    if (!vm.count("timer-frequency"))
-    {
-        op.freq = 1000;
-    }
-
     if (vm.count("quiet"))
     {
         op.verbose = false;
     }
-    else if (vm.count("verbose"))
+    else
     {
-        op.verbose = true;
+        op.verbose = vm.count("verbose");
     }
+
+    if (vm.count("timer-frequency"))
+    {
+        if (op.freq <= 0)
+        {
+            string msg("Timer frequency must be positive!");
+            throw cigma::Exception("CompareCmd::configure", msg, 1);
+        }
+        if (!vm.count("quiet"))
+        {
+            op.verbose = true;
+        }
+    }
     else
     {
-        op.verbose = false;
+        // use 1000 cells as the default timer freq
+        op.freq = 1000;
     }
 
     op.first_info.fn_name = first;
@@ -262,10 +271,10 @@
     {
         cout << endl;
         cout << "Comparing " << first << " and " << second << endl;
-        cout << endl;
 
         if (op.verbose)
         {
+            cout << endl;
             cout << "Progress of comparison" << endl;
         }
     }



More information about the CIG-COMMITS mailing list