Warn on unknown --channel-config args

This commit is contained in:
Dennis Klein
2021-02-25 17:33:38 +01:00
committed by Dennis Klein
parent c37742e3b4
commit 8327810942

View File

@@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * Copyright (C) 2017-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* * * *
* This software is distributed under the terms of the * * This software is distributed under the terms of the *
* GNU Lesser General Public License (LGPL) version 3, * * GNU Lesser General Public License (LGPL) version 3, *
@@ -84,6 +84,7 @@ Properties SuboptParser(const vector<string>& channelConfig, const string& devic
char* subopts = &argString[0]; char* subopts = &argString[0];
char* value = nullptr; char* value = nullptr;
while (subopts && *subopts != 0 && *subopts != ' ') { while (subopts && *subopts != 0 && *subopts != ' ') {
char* cur = subopts;
int subopt = getsubopt(&subopts, (char**)channelOptionKeys, &value); int subopt = getsubopt(&subopts, (char**)channelOptionKeys, &value);
if (subopt == NAME) { if (subopt == NAME) {
channelName = value; channelName = value;
@@ -94,6 +95,8 @@ Properties SuboptParser(const vector<string>& channelConfig, const string& devic
socketsArray.push_back(make_pair("", socketProperties)); socketsArray.push_back(make_pair("", socketProperties));
} else if (subopt >= 0 && value != nullptr) { } else if (subopt >= 0 && value != nullptr) {
channelProperties.put(channelOptionKeys[subopt], value); channelProperties.put(channelOptionKeys[subopt], value);
} else if (subopt == -1) {
LOG(warn) << "Ignoring unknown argument in --channel-config: " << cur;
} }
} }