DNS Lookup: Use standard functions to print version/help
showHelp was already in use, but not showVersion. Return 0 in both cases, even if it's unreachable. Task-number: QTBUG-108873 Change-Id: Iba820e89d7de066130163e7829f75bbfcfa3f7dd Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 83dac218130a5e91616d1cd515815f0ce9b6c332) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f48290d498
commit
4c470e7eef
@ -189,12 +189,11 @@ int main(int argc, char *argv[])
|
|||||||
fputs(qPrintable(parser.helpText()), stderr);
|
fputs(qPrintable(parser.helpText()), stderr);
|
||||||
return 1;
|
return 1;
|
||||||
case CommandLineVersionRequested:
|
case CommandLineVersionRequested:
|
||||||
printf("%s %s\n", qPrintable(QCoreApplication::applicationName()),
|
parser.showVersion();
|
||||||
qPrintable(QCoreApplication::applicationVersion()));
|
Q_UNREACHABLE_RETURN(0);
|
||||||
return 0;
|
|
||||||
case CommandLineHelpRequested:
|
case CommandLineHelpRequested:
|
||||||
parser.showHelp();
|
parser.showHelp();
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE_RETURN(0);
|
||||||
}
|
}
|
||||||
//! [1]
|
//! [1]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user