|
@@ -447,8 +447,10 @@ QHash<QString, QVariant> ctkCommandLineParser::parseArguments(const QStringList&
|
|
{
|
|
{
|
|
qDebug() << " Processing parameter" << j << ", value:" << parameter;
|
|
qDebug() << " Processing parameter" << j << ", value:" << parameter;
|
|
}
|
|
}
|
|
- if (this->argumentAdded(parameter))
|
|
|
|
|
|
+ if (this->Internal->argumentDescription(parameter) != 0)
|
|
{
|
|
{
|
|
|
|
+ // we've found a known argument, it means there are no more
|
|
|
|
+ // parameter for the current argument
|
|
this->Internal->ErrorString =
|
|
this->Internal->ErrorString =
|
|
missingParameterError.arg(argument).arg(j-1).arg(numberOfParametersToProcess);
|
|
missingParameterError.arg(argument).arg(j-1).arg(numberOfParametersToProcess);
|
|
if (this->Internal->Debug) { qDebug() << this->Internal->ErrorString; }
|
|
if (this->Internal->Debug) { qDebug() << this->Internal->ErrorString; }
|
|
@@ -478,12 +480,15 @@ QHash<QString, QVariant> ctkCommandLineParser::parseArguments(const QStringList&
|
|
int j = 1;
|
|
int j = 1;
|
|
while(j + i < arguments.size())
|
|
while(j + i < arguments.size())
|
|
{
|
|
{
|
|
- if (this->argumentAdded(arguments.at(j + i)))
|
|
|
|
|
|
+ if (this->Internal->argumentDescription(arguments.at(j + i)) != 0)
|
|
{
|
|
{
|
|
|
|
+ // we've found a known argument, it means there are no more
|
|
|
|
+ // parameter for the current argument
|
|
if (this->Internal->Debug)
|
|
if (this->Internal->Debug)
|
|
{
|
|
{
|
|
qDebug() << " No more parameter for" << argument;
|
|
qDebug() << " No more parameter for" << argument;
|
|
}
|
|
}
|
|
|
|
+ j--; // this parameter does not belong to current argument
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
QString parameter = arguments.at(j + i);
|
|
QString parameter = arguments.at(j + i);
|