From c953a143b2ccbd6ece2a9291c895e3e579b0fc3e Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Thu, 11 Feb 2021 11:36:26 +0100 Subject: [PATCH] usage --- sink/sink20169.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/sink/sink20169.c b/sink/sink20169.c index cf2b8cd..4598bcc 100644 --- a/sink/sink20169.c +++ b/sink/sink20169.c @@ -306,6 +306,18 @@ int forwardMinuteBuffer(t_forwarderHandle *handle, t_minuteBuffer *buf) { return 0; } +void usage() { + printf("sinkserver for mainsfrequency counter\n"); + printf("https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-stm32\n"); + printf("Version: " VERSION "\n"); + printf("\nUsage\n"); + printf(" -f FILENAME R..... Config file to be used\n"); + printf(" -v ............... Verbose, writes all logging on stdout too\n"); + printf(" -s FACILITY ...... Sets syslog facility, only LOCAL[0..7]\n"); + printf(" USER and DAEMON are supported\n"); + printf(" -h ............... This help\n"); +} + int main(int argc, char **argv) { t_configHandle configHandle; t_forwarderHandle forwarderHandle; @@ -327,15 +339,7 @@ int main(int argc, char **argv) { 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"); - printf("\nUsage\n"); - printf(" -f FILENAME R..... Config file to be used\n"); - printf(" -v ............... Verbose, writes all logging on stdout too\n"); - printf(" -s FACILITY ...... Sets syslog facility, only LOCAL[0..7]\n"); - printf(" USER and DAEMON are supported\n"); - printf(" -h ............... This help\n"); + usage(); exit(0); break; } @@ -374,4 +378,5 @@ int main(int argc, char **argv) { deinitForwarder(&forwarderHandle); deinitReceiver(&receiverHandle); deinitConfig(&configHandle); + free(configFilename); }