First check if key was setted.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-10-07 20:59:52 +03:00
parent 1aaef9e406
commit 951f6f2f4e

View File

@ -534,6 +534,8 @@ void MApplication::ParseCommandLine(const SocketConnection &connection, const QS
int height = 0;
Unit unit = Unit::Cm;
if (parser.isSet(heightOption))
{
const QString heightValue = parser.value(heightOption);
if (VMeasurement::IsGradationHeightValid(heightValue))
{
@ -547,7 +549,10 @@ void MApplication::ParseCommandLine(const SocketConnection &connection, const QS
.arg(VMeasurement::WholeListHeights(Unit::Cm).join(", "))));
parser.showHelp(V_EX_USAGE);
}
}
if (parser.isSet(sizeOption))
{
const QString sizeValue = parser.value(sizeOption);
if (VMeasurement::IsGradationSizeValid(sizeValue))
{
@ -561,6 +566,7 @@ void MApplication::ParseCommandLine(const SocketConnection &connection, const QS
.arg(VMeasurement::WholeListSizes(Unit::Cm).join(", "))));
parser.showHelp(V_EX_USAGE);
}
}
{
const QString unitValue = parser.value(unitOption);