add help output to simulator bench/tester
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 12 Dec 2006 13:50:35 +0100
changeset 189 fcfc2247da10
parent 188 1d26db54338c
child 190 916cd1bfed82
add help output to simulator bench/tester
utils/bench-simulator.cc
--- a/utils/bench-simulator.cc	Mon Dec 11 19:43:46 2006 +0100
+++ b/utils/bench-simulator.cc	Tue Dec 12 13:50:35 2006 +0100
@@ -110,10 +110,28 @@
   m_n++;
 }
 
+void
+PrintHelp (void)
+{
+  std::cout << "bench-simulator filename [options]"<<std::endl;
+  std::cout << "  filename: a string which identifies the input distribution. \"-\" represents stdin." << std::endl;
+  std::cout << "  Options:"<<std::endl;
+  std::cout << "      --list: use std::list scheduler"<<std::endl;
+  std::cout << "      --map: use std::map cheduler"<<std::endl;
+  std::cout << "      --heap: use Binary Heap scheduler"<<std::endl;
+  std::cout << "      --log=filename: log scheduler events for the event replay utility."<<std::endl;
+  std::cout << "      --debug: enable some debugging"<<std::endl;
+}
+
 int main (int argc, char *argv[])
 {
   char const *filename = argv[1];
   std::istream *input;
+  if (argc == 1)
+    {
+      PrintHelp ();
+      return 0;
+    }
   argc-=2;
   argv+= 2;
   if (strcmp (filename, "-") == 0) {