From 78712006ffd294c2031ec6df9beba26ad6de7bd1 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Tue, 21 Feb 2012 14:27:47 +0100
Subject: [PATCH] BUG: Enable only parameters that are actually there in the
 command-line

---
 Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
index 644ba30292..077f542d94 100644
--- a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
+++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
@@ -363,9 +363,6 @@ CommandLineLauncher::ParamResultType CommandLineLauncher::LoadParameters()
 
     const bool paramExists(m_Parser->IsAttributExists(std::string("-").append(paramKey), m_Expression));
 
-    // Ensure that the parameter is enabled
-    m_Application->EnableParameter(paramKey);
-
     // if param is a Group, dont do anything, ParamGroup dont have values
     if (type != ParameterType_Group)
       {
@@ -383,6 +380,9 @@ CommandLineLauncher::ParamResultType CommandLineLauncher::LoadParameters()
           return INVALIDNUMBEROFVALUE;
           }
         
+        // Ensure that the parameter is enabled
+        m_Application->EnableParameter(paramKey);
+
         if (type == ParameterType_InputVectorDataList)
           {
           dynamic_cast<InputVectorDataListParameter *> (param.GetPointer())->SetListFromFileName(values);
-- 
GitLab