made Commadnlineoptions into a class
Some checks failed
Build on RHEL9 / build (push) Failing after 12s
Build on RHEL8 / build (push) Failing after 18s

This commit is contained in:
2025-07-07 14:52:01 +02:00
parent d18ea00b85
commit 9a37cee4e9
5 changed files with 286 additions and 202 deletions

View File

@@ -31,7 +31,8 @@ void sigInterruptHandler(int signal) {
int main(int argc, char *argv[]) {
auto opts = parseCommandLine(AppType::SingleReceiver, argc, argv);
CommandLineOptions cli(AppType::SingleReceiver);
auto opts = cli.parse(argc, argv);
auto& o = std::get<CommonOptions>(opts);
if (o.versionRequested || o.helpRequested) {
return EXIT_SUCCESS;
@@ -39,8 +40,11 @@ int main(int argc, char *argv[]) {
LOG(sls::logINFOBLUE) << "Current Process [ Tid: " << gettid() << " ]";
setupSignalHandler(SIGINT, sigInterruptHandler); // close files on ctrl+c
setupSignalHandler(SIGPIPE, SIG_IGN); // handle locally on socket crash
// close files on ctrl+c
CommandLineOptions::setupSignalHandler(SIGINT, sigInterruptHandler);
// handle locally on socket crash
CommandLineOptions::setupSignalHandler(SIGPIPE, SIG_IGN);
sem_init(&semaphore, 1, 0);
try {