From 5023f0d84361b2b82fe21f6118c6237bff0e6270 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Tue, 27 Oct 2015 18:26:23 +0100
Subject: [PATCH] ENH: command line launcher help read actual default output
 pixel types

---
 .../src/otbWrapperCommandLineLauncher.cxx        | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
index c3cd479b17..84a9112dbf 100644
--- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
+++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
@@ -844,14 +844,26 @@ std::string CommandLineLauncher::DisplayParameterHelp(const Parameter::Pointer &
 
   if (type == ParameterType_OutputImage)
     {
+    OutputImageParameter* paramDown = dynamic_cast<OutputImageParameter*>(param.GetPointer());
+    std::string defPixType("float");
+    if (paramDown)
+      {
+      defPixType = OutputImageParameter::ConvertPixelTypeToString(paramDown->GetDefaultPixelType());
+      }
     oss << " [pixel=uint8/uint16/int16/uint32/int32/float/double]";
-    oss << " (default value is float)";
+    oss << " (default value is " << defPixType <<")";
     }
 
   if (type == ParameterType_ComplexOutputImage)
     {
+    ComplexOutputImageParameter* paramDown = dynamic_cast<ComplexOutputImageParameter*>(param.GetPointer());
+    std::string defPixType("cfloat");
+    if (paramDown)
+      {
+      defPixType = ComplexOutputImageParameter::ConvertPixelTypeToString(paramDown->GetDefaultComplexPixelType());
+      }
     oss << " [pixel=cfloat/cdouble]";
-    oss << " (default value is cfloat)";
+    oss << " (default value is "<< defPixType <<")";
     }
 
 
-- 
GitLab