From 07a9fafcf251c5a4bc920b6e0d798dfaae82c6ec Mon Sep 17 00:00:00 2001 From: "Parzych, Hubert" Date: Tue, 10 Oct 2023 11:17:14 +0200 Subject: [PATCH] refator(discoverysrv): make boost::program_options namespace alias global --- ebpfdiscoverysrv/src/main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ebpfdiscoverysrv/src/main.cpp b/ebpfdiscoverysrv/src/main.cpp index 9664da8b..cd8381ee 100644 --- a/ebpfdiscoverysrv/src/main.cpp +++ b/ebpfdiscoverysrv/src/main.cpp @@ -14,6 +14,9 @@ #include #include +namespace po = boost::program_options; +using logging::LogLevel; + enum class ProgramStatus { Running, UnixShutdownSignalReceived, @@ -26,10 +29,7 @@ std::mutex programStatusMutex; * CLI options */ -using logging::LogLevel; - -static boost::program_options::options_description getProgramOptions() { - namespace po = boost::program_options; +static po::options_description getProgramOptions() { po::options_description desc{"Options"}; // clang-format off @@ -40,8 +40,8 @@ static boost::program_options::options_description getProgramOptions() { ("log-no-stdout", po::value()->default_value(false), "Disable logging to stdout") ("version", "Display program version") ; - // clang-format on + return desc; } @@ -115,7 +115,6 @@ static void setupLibbpf() { } int main(int argc, char** argv) { - namespace po = boost::program_options; po::options_description desc{getProgramOptions()}; po::variables_map vm;