result: Add option to not print the output

In some cases it can be helpful to suppress all the output, for example
for a stress test where the benchmark should not spend less time as
possible doing things other than the benchmark itself.
Add the new "null" command line option to suppress all the output.

Test: /dittobench --format=null test/example/write_random.ditto
Bug: 252808520
Change-Id: I8c275b20ba6a5f352188c9dc3221c50eee8f8784
Signed-off-by: Alessio Balsini <balsini@google.com>
diff --git a/include/ditto/result.h b/include/ditto/result.h
index d19b9e7..7e244de 100644
--- a/include/ditto/result.h
+++ b/include/ditto/result.h
@@ -24,7 +24,7 @@
 
 namespace dittosuite {
 
-enum class ResultsOutput { kReport, kCsv };
+enum class ResultsOutput { kNull = -1, kReport = 0, kCsv = 1 };
 
 class Result {
  public:
diff --git a/src/arg_parser.cpp b/src/arg_parser.cpp
index 2d7cad5..da09791 100644
--- a/src/arg_parser.cpp
+++ b/src/arg_parser.cpp
@@ -20,6 +20,9 @@
   if (optarg == "csv" || optarg == "1") {
     return ResultsOutput::kCsv;
   }
+  if (optarg == "null" || optarg == "-1") {
+    return ResultsOutput::kCsv;
+  }
   return ResultsOutput::kReport;  // by default, the results output is the report (= 0)
 }
 
@@ -61,8 +64,10 @@
             << "Benchmarking tool for generic workloads.\n\n"
 
             << "  -f, --format[=FMT]"
-            << "\tresults output format.\n"
-            << "\t\t\tFMT can be: report (or 0, default), csv (or 1)\n"
+            << "\tresults output format, where FMT can be one of:\n"
+            << "\t\t\t  - report (or 0, default): human readable summary;\n"
+            << "\t\t\t  - csv (or 1): for comma-separated detailed stats;\n"
+            << "\t\t\t  - null (-1): do not print.\n"
 
             << "  -p, --param[=PAR]..."
             << "\tif the benchmark is parametric, all the parameters can be passed\n"
diff --git a/src/result.cpp b/src/result.cpp
index dbb494b..a31d3fc 100644
--- a/src/result.cpp
+++ b/src/result.cpp
@@ -78,6 +78,8 @@
     case ResultsOutput::kCsv:
       MakeStatisticsCsv();
       break;
+    case ResultsOutput::kNull:
+      break;
   }
 }