This commit is contained in:
2021-02-11 11:28:43 +01:00
parent dd570a9393
commit 5dcbacb7a3
4 changed files with 59 additions and 9 deletions

View File

@ -2,6 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
@ -48,6 +49,8 @@ typedef struct {
char influxUrl[1024];
} t_forwarderHandle;
bool verbose = false;
int initConfig(const char *configFilename, t_configHandle *configHandle) {
configHandle->numOfDevices = 0;
@ -312,11 +315,22 @@ int main(int argc, char **argv) {
const char *configFilename = DEFAULT_CONFIG_FILENAME;
int c;
while ((c = getopt(argc, argv, "f:")) != -1) {
while ((c = getopt(argc, argv, "f:vs:")) != -1) {
switch (c) {
case 'f':
configFilename = strdup(optarg);
break;
case 'v':
verbose = true;
break;
case 's':
setfacility(optarg);
break;
case 'h':
printf("sinkserver for mainsfrequency counter\n");
printf("https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-stm32\n");
printf("Version: " VERSION "\n");
break;
}
}