summaryrefslogtreecommitdiffstats
path: root/examples/network/dnslookup
diff options
context:
space:
mode:
authorMÃ¥rten Nordheim <marten.nordheim@qt.io>2023-02-27 17:44:45 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-02 11:08:32 +0000
commit4c470e7eef78046942b29bda299047a816d97500 (patch)
tree2958d6eb1d919b2ceb9d55e8d4644e6d0b353c12 /examples/network/dnslookup
parentf48290d498b1703daf706eafff52f5515810c895 (diff)
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>
Diffstat (limited to 'examples/network/dnslookup')
-rw-r--r--examples/network/dnslookup/dnslookup.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/network/dnslookup/dnslookup.cpp b/examples/network/dnslookup/dnslookup.cpp
index 91311b26b8..264a8e37fa 100644
--- a/examples/network/dnslookup/dnslookup.cpp
+++ b/examples/network/dnslookup/dnslookup.cpp
@@ -189,12 +189,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]