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
Pick-to: 6.5
Change-Id: Iba820e89d7de066130163e7829f75bbfcfa3f7dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Mårten Nordheim 2023-02-27 17:44:45 +01:00
parent a6dc860915
commit 83dac21813

View File

@ -205,12 +205,11 @@ int main(int argc, char *argv[])
fputs(qPrintable(parser.helpText()), stderr);
return 1;
case CommandLineVersionRequested:
printf("%s %s\n", qPrintable(QCoreApplication::applicationName()),
qPrintable(QCoreApplication::applicationVersion()));
return 0;
parser.showVersion();
Q_UNREACHABLE_RETURN(0);
case CommandLineHelpRequested:
parser.showHelp();
Q_UNREACHABLE();
Q_UNREACHABLE_RETURN(0);
}
//! [1]