Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
fd69237d
Commit
fd69237d
authored
12 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
BUG: 556 : fix wrong MISSING parameter in command line launcher
parent
324ca43b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
+32
-11
32 additions, 11 deletions
Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
with
32 additions
and
11 deletions
Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
+
32
−
11
View file @
fd69237d
...
...
@@ -499,10 +499,11 @@ CommandLineLauncher::ParamResultType CommandLineLauncher::LoadParameters()
}
}
// Check if mandatory parameter are present and have value
// A param has to be set if it is mandatory and :
// is root OR its parent is active
// NB: a root parameter is not active
// When a parameter is mandatory :
// it must be set if :
// - The param is root
// - The param is not root and belonging to a Mandatory Group
// wich is activated
bool
mustBeSet
=
false
;
const
bool
hasValue
=
m_Application
->
HasValue
(
paramKey
);
...
...
@@ -657,6 +658,8 @@ std::string CommandLineLauncher::DisplayParameterHelp(const Parameter::Pointer &
{
// Display the type the type
ParameterType
type
=
m_Application
->
GetParameterType
(
paramKey
);
// Discard Group parameters (they don't need a value)
if
(
type
==
ParameterType_Group
)
{
return
""
;
...
...
@@ -664,10 +667,11 @@ std::string CommandLineLauncher::DisplayParameterHelp(const Parameter::Pointer &
std
::
ostringstream
oss
;
// Check if mandatory parameter are present and have value
// A param has to be set if it is mandatory and :
// is root OR its parent is active
// NB: a root parameter is not active
// When a parameter is mandatory :
// it must be set if :
// - The param is root
// - The param is not root and belonging to a Mandatory Group
// wich is activated
bool
isMissing
=
false
;
if
(
!
m_Parser
->
IsAttributExists
(
std
::
string
(
"-"
).
append
(
paramKey
),
m_Expression
))
{
...
...
@@ -675,11 +679,28 @@ std::string CommandLineLauncher::DisplayParameterHelp(const Parameter::Pointer &
{
if
(
param
->
GetMandatory
()
&&
param
->
GetRole
()
!=
Role_Output
)
{
if
(
param
->
GetRoot
()
->
GetActive
()
||
param
->
IsRoot
()
||
param
->
GetRoot
()
->
GetMandatory
()
)
if
(
param
->
IsRoot
()
||
param
->
GetRoot
()
->
IsRoot
())
{
if
(
type
!=
ParameterType_Group
)
// the parameter is a root or inside a group at root level
isMissing
=
true
;
}
else
{
Parameter
*
currentParam
=
param
->
GetRoot
();
while
(
!
currentParam
->
IsRoot
())
{
isMissing
=
true
;
if
(
!
currentParam
->
GetActive
())
{
// the missing parameter is not on an active branch : we can ignore it
break
;
}
currentParam
=
currentParam
->
GetRoot
();
if
(
currentParam
->
IsRoot
())
{
// the missing parameter is on an active branch : we need it
isMissing
=
true
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment