]> AND Private Git Repository - loba.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Make boolean option togglable.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 19 Jan 2011 10:37:29 +0000 (11:37 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 19 Jan 2011 10:37:29 +0000 (11:37 +0100)
options.cpp

index 8ef0acf74a1f2d9b1b5683cfa02b2783d97da3dd..89f8b18eb3287b5afd0d95ddf5c226b44de4d685 100644 (file)
@@ -188,10 +188,10 @@ bool opt::parse_args(int* argc, char* argv[])
                 && result;
             break;
         case 'b':
                 && result;
             break;
         case 'b':
-            opt::bookkeeping = true;
+            opt::bookkeeping = !opt::bookkeeping;
             break;
         case 'e':
             break;
         case 'e':
-            opt::exit_on_close = true;
+            opt::exit_on_close = !opt::exit_on_close;
             break;
         case 'h':
             opt::help_requested++;
             break;
         case 'h':
             opt::help_requested++;
@@ -354,7 +354,8 @@ void opt::usage()
               << " [" << opt::loba_algo << "]\n";
     if (opt::help_requested > 1)
         so_list(opt::loba_algorithms);
               << " [" << opt::loba_algo << "]\n";
     if (opt::help_requested > 1)
         so_list(opt::loba_algorithms);
-    std::clog << o("-b") << "enable bookkeeping (\"virtual load\")\n";
+    std::clog << o("-b") << "toggle bookkeeping (\"virtual load\")"
+              << " [" << opt_helper::on_off(opt::bookkeeping) << "]\n";
 
     std::clog << "\nApplication parameters\n";
     std::clog << o("-c [fn,...]f0")
 
     std::clog << "\nApplication parameters\n";
     std::clog << o("-c [fn,...]f0")
@@ -377,7 +378,8 @@ void opt::usage()
     std::clog << o("-t value")
               << "time limit (simulated time), 0 for infinity"
               << " [" << opt::time_limit << "]\n";
     std::clog << o("-t value")
               << "time limit (simulated time), 0 for infinity"
               << " [" << opt::time_limit << "]\n";
-    std::clog << o("-e") << "exit on reception of \"close\" message\n";
+    std::clog << o("-e") << "toggle exit on reception of \"close\" message"
+              << " [" << opt_helper::on_off(opt::exit_on_close) << "]\n";
 
     if (opt::help_requested < 3)
         return;
 
     if (opt::help_requested < 3)
         return;