From 8b5b2edb0f79ed52dd787dad4faec3d4f90e8e76 Mon Sep 17 00:00:00 2001 From: structix Date: Sat, 16 Dec 2017 22:22:02 +0100 Subject: [PATCH] Added showhelp --- README.md | 10 ++++++++++ csoundbox.c | 8 +++++++- csoundbox.h | 1 + udpserver.c | 11 +++++------ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 806f425..ce85313 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,19 @@ A soundboard to trigger sounds remotely or local with a keyboard. +## Compile & install + First install * libao * mpg123 +* libconfig On Debian: ``` sudo apt-get install libao-dev sudo apt-get install mpg123 +sudo apt-get install libconfig-dev ``` @@ -25,3 +29,9 @@ to default_driver=pulse ``` +## Arguments + +* -h: Show the help screen and exit +* -s: Start the server +* -i : connect to a server +* -l or without arguments: Start local diff --git a/csoundbox.c b/csoundbox.c index 77278b8..d0ba1cc 100644 --- a/csoundbox.c +++ b/csoundbox.c @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) { break; case 'h': //show the help page - + showHelp(); break; case 'i': //connect to a csoundbox server @@ -111,4 +111,10 @@ void printCursesWelcome(void) { mvprintw(y + 1, x - (strlen(msg2) / 2), msg2); } +void showHelp(void) { + printf("-h: Show the help screen and exit\n"); + printf("-s: Start the server\n"); + printf("-i : connect to a server\n"); + printf("-l or without arguments: Start local\n"); +} diff --git a/csoundbox.h b/csoundbox.h index fe557ca..e896561 100644 --- a/csoundbox.h +++ b/csoundbox.h @@ -2,3 +2,4 @@ void inputLocal(void); void printCursesWelcome(void); void inputNetwork(char *server); +void showHelp(void); diff --git a/udpserver.c b/udpserver.c index 57b691e..8e954f6 100644 --- a/udpserver.c +++ b/udpserver.c @@ -1,8 +1,8 @@ -#include //printf -#include //memset, strtok -#include //exit(0); -#include -#include +#include //printf +#include //memset, strtok +#include //exit(0); +#include +#include #include //close() #include "udpserver.h" @@ -13,7 +13,6 @@ //#define PORT 8888 -#include "udpserver.h" void die(char *s) { perror(s);