[mlpack-git] master: Only print output parameters that are strings and end with "_file". (511596d)

gitdub at mlpack.org gitdub at mlpack.org
Wed Jul 13 16:14:25 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/59bc0b32630a3ad786706993f4d5e8b087f1c702...0d9a0e263a32b99d8dcf5d2723b3b92c67e669fc

>---------------------------------------------------------------

commit 511596d2b3561dc93a08fe4e18baa86e3a2b76b6
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Jul 13 16:14:25 2016 -0400

    Only print output parameters that are strings and end with "_file".


>---------------------------------------------------------------

511596d2b3561dc93a08fe4e18baa86e3a2b76b6
 src/mlpack/core/util/cli.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mlpack/core/util/cli.cpp b/src/mlpack/core/util/cli.cpp
index dcc1db4..468f9a4 100644
--- a/src/mlpack/core/util/cli.cpp
+++ b/src/mlpack/core/util/cli.cpp
@@ -608,6 +608,11 @@ void CLI::PrintHelp(const std::string& param)
       if ((pass == 2) && input) // Output options only (always optional).
         continue;
 
+      // Only print string output options that end in "_file".
+      if ((pass == 2) && ((data.tname != TYPENAME(std::string)) ||
+          (data.name.substr(data.name.size() - 5, 5) != "_file")))
+        continue;
+
       if (!printedHeader)
       {
         printedHeader = true;




More information about the mlpack-git mailing list