From: Remi Gacogne Date: Tue, 23 Dec 2025 10:20:44 +0000 (+0100) Subject: clang-tidy: Reduce the complexity of the main function X-Git-Tag: rec-5.4.0-beta1~62^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f828b3d5a541c4a3ee5702188500f2f4c44199a;p=thirdparty%2Fpdns.git clang-tidy: Reduce the complexity of the main function Signed-off-by: Remi Gacogne --- diff --git a/pdns/calidns.cc b/pdns/calidns.cc index a3b07f4729..49c4c41249 100644 --- a/pdns/calidns.cc +++ b/pdns/calidns.cc @@ -311,8 +311,7 @@ namespace { */ -int main(int argc, char** argv) -try +static std::optional parse_options(int argc, char** argv) { po::options_description desc("Options"); desc.add_options() @@ -361,6 +360,17 @@ try return EXIT_FAILURE; } + return std::nullopt; +} + +int main(int argc, char** argv) +try +{ + auto result = parse_options(argc, argv); + if (result) { + return *result; + } + float increment = 1.1; try { increment = g_vm["increment"].as();