From 232cf21c35c79458969fd661d18ca779c5418c2e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 Oct 2020 10:57:41 +0000 Subject: statics --- net_keypad.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'net_keypad.c') diff --git a/net_keypad.c b/net_keypad.c index 9169b80..e315704 100644 --- a/net_keypad.c +++ b/net_keypad.c @@ -14,7 +14,7 @@ static int usage (const char *name) { fprintf (stderr, "Usage:\n"); - fprintf (stderr, "%s -h host [-p port]\n", name); + fprintf (stderr, "%s -h host [ -p port ] [ -d debug ] [ -l log_file ]\n", name); fprintf (stderr, "\n"); return -1; @@ -26,9 +26,11 @@ int main (int argc, char *argv[]) unsigned opt; const char *host = NULL; unsigned port = 10001; + const char *log = NULL; + int debug = 0; int fd; - while ((opt = getopt (argc, argv, "h:p:z:USPRBFTAD")) != -1) { + while ((opt = getopt (argc, argv, "h:p:z:dl:")) != -1) { switch (opt) { case 'h': host = optarg; @@ -38,6 +40,14 @@ int main (int argc, char *argv[]) port = atoi (optarg); break; + case 'd': + debug++; + break; + + case 'l': + log = optarg; + break; + default: /* '?' */ return usage (argv[0]); } @@ -52,5 +62,5 @@ int main (int argc, char *argv[]) return -1; } - return gd_keypad (fd); + return gd_keypad (fd, log, debug); } -- cgit v1.2.3