From d5ed420a695b80e05013df426eb592c71eb94bc9 Mon Sep 17 00:00:00 2001
From: Cyrille Valladeau <cyrille.valladeau@c-s.fr>
Date: Wed, 21 Sep 2011 15:01:56 +0200
Subject: [PATCH] ENH: suppress cout

---
 Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx | 5 ++---
 Code/Wrappers/CommandLine/otbWrapperCommandLineParser.cxx   | 5 +++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
index eaefbd445e..3a928084ad 100644
--- a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
+++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
@@ -107,7 +107,7 @@ CommandLineLauncher::Load()
 
   if( this->LoadPath() == false )
     {
-    std::cerr << "ERROR: At least one specifed path within \""<< m_Parser->GetAttributAsString(m_Parser->GetModulePathKey(), m_Expression)<<"\" is invalid..." <<std::endl;
+    std::cerr << "ERROR: At least one specifed path within \""<< m_Parser->GetAttributAsString(m_Parser->GetModulePathKey(), m_Expression)<<"\" is invalid or doesn't exist..." <<std::endl;
     return false;
     }
 
@@ -239,7 +239,6 @@ CommandLineLauncher::LoadPath()
     {
     for( unsigned i=0; i<pathList.size(); i++)
       {
-      std::cout<<pathList[i]<<std::endl;
       ApplicationRegistry::AddApplicationPath(pathList[i]);
       }
     }
@@ -281,7 +280,7 @@ CommandLineLauncher::LoadApplication()
       std::cerr << "ERROR: Available modules :" << std::endl;
       for (std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it)
         {
-        std::cout << "\t" << *it << std::endl;
+        std::cerr << "\t" << *it << std::endl;
         }
       return;
       }
diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineParser.cxx b/Code/Wrappers/CommandLine/otbWrapperCommandLineParser.cxx
index fc3a57f325..f796120ad1 100644
--- a/Code/Wrappers/CommandLine/otbWrapperCommandLineParser.cxx
+++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineParser.cxx
@@ -157,15 +157,16 @@ CommandLineParser::GetModuleName( std::string & modName, const std::string & exp
 std::vector<std::string>
 CommandLineParser::GetAttribut( const std::string & key, const std::string & exp )
 {
+  std::vector<std::string> res;
+
   std::string keySpaced = key;
   keySpaced.append(" ");
   std::size_t found = std::string(exp).find(keySpaced);
   if( found == std::string::npos )
     {
-    itkExceptionMacro("No key \""<<key<<"\" found in \""<<exp<<"\".");
+    return res;
     }
   
-  std::vector<std::string> res;
   std::string expFromKey = std::string(exp).substr(found+key.size(), std::string(exp).size());
   
   if( expFromKey.size() == 0 )
-- 
GitLab