From 0a86cf57e3495d6f7c7d8565492e02b9c1276326 Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 10 Mar 2017 13:32:49 +0000 Subject: Implement quiet mode --- config.def.h | 1 + ratox.1 | 5 ++++- ratox.c | 8 ++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config.def.h b/config.def.h index e98c1ed..bb619fc 100644 --- a/config.def.h +++ b/config.def.h @@ -30,6 +30,7 @@ static int ipv6 = 0; static int tcp = 0; static int proxy = 0; static TOX_PROXY_TYPE proxytype = TOX_PROXY_TYPE_SOCKS5; /* NONE, HTTP, SOCKS5 */ +static int quiet = 0; static char proxyaddr[] = "localhost"; static uint16_t proxyport = 8080; diff --git a/ratox.1 b/ratox.1 index 092b390..c24897b 100644 --- a/ratox.1 +++ b/ratox.1 @@ -1,4 +1,4 @@ -.Dd December 8, 2014 +.Dd March 10, 2017 .Dt RATOX 1 .Os .Sh NAME @@ -10,6 +10,7 @@ .Op Fl E | Fl e .Op Fl T | Fl t .Op Fl P | Fl p +.Op Fl q .Op Ar savefile .Sh DESCRIPTION .Nm @@ -26,6 +27,8 @@ Enable/Disable TCP mode. Avoiding UDP in tox implies certain security considerations. .It Fl P p Enable/Disable TCP HTTP/SOCKS5 proxy as specified in \fIconfig.h\fR. +.It Fl q +Enable quiet mode. .It Ar savefile Path of the file to load a profile from or create a new one in. .El diff --git a/ratox.c b/ratox.c index d767630..2130916 100644 --- a/ratox.c +++ b/ratox.c @@ -2293,7 +2293,7 @@ toxshutdown(void) static void usage(void) { - eprintf("usage: %s [-4|-6] [-E|-e] [-T|-t] [-P|-p] [savefile]\n", argv0); + eprintf("usage: %s [-4|-6] [-E|-e] [-T|-t] [-P|-p] [-q] [savefile]\n", argv0); } int @@ -2324,6 +2324,9 @@ main(int argc, char *argv[]) case 'p': proxy = 0; break; + case 'q': + quiet = 1; + break; default: usage(); } ARGEND; @@ -2341,7 +2344,8 @@ main(int argc, char *argv[]) signal(SIGTERM, initshutdown); signal(SIGPIPE, SIG_IGN); - printrat(); + if (!quiet) + printrat(); toxinit(); localinit(); friendload(); -- cgit v1.2.3