From 951cf1f8b955d2c473cd5b24d5317bedf2e02849 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sat, 26 Jan 2019 10:03:37 +0000 Subject: [PATCH] Add `-t` option to run tests on self Right now only prints --- daemon/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/daemon/main.c b/daemon/main.c index 608aba0..234b26a 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -67,6 +67,7 @@ POSSIBILITY OF SUCH DAMAGE. " -d daemonize self after launch\n" \ " -l log to syslog\n" \ " -r request gamemode and pause\n" \ + " -t run tests on self\n" \ " -h print this help\n" \ " -v print version\n" \ "\n" \ @@ -96,7 +97,7 @@ int main(int argc, char *argv[]) bool daemon = false; bool use_syslog = false; int opt = 0; - while ((opt = getopt(argc, argv, "dlsrvh")) != -1) { + while ((opt = getopt(argc, argv, "dlsrtvh")) != -1) { switch (opt) { case 'd': daemon = true; @@ -140,6 +141,10 @@ int main(int argc, char *argv[]) // Simply pause and wait for any signal pause(); + exit(EXIT_SUCCESS); + break; + case 't': + fprintf(stdout, "Running tests...\n"); exit(EXIT_SUCCESS); break; case 'v':