tImplement quiet mode - ratox - FIFO based tox client
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 0a86cf57e3495d6f7c7d8565492e02b9c1276326
(DIR) parent f249076a9c422588cdfdad334325dbd3d29595af
(HTM) Author: sin <sin@2f30.org>
Date: Fri, 10 Mar 2017 13:32:49 +0000
Implement quiet mode
Diffstat:
M config.def.h | 1 +
M ratox.1 | 5 ++++-
M ratox.c | 8 ++++++--
3 files changed, 11 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/config.def.h b/config.def.h
t@@ -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;
(DIR) diff --git a/ratox.1 b/ratox.1
t@@ -1,4 +1,4 @@
-.Dd December 8, 2014
+.Dd March 10, 2017
.Dt RATOX 1
.Os
.Sh NAME
t@@ -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
t@@ -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
(DIR) diff --git a/ratox.c b/ratox.c
t@@ -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
t@@ -2324,6 +2324,9 @@ main(int argc, char *argv[])
case 'p':
proxy = 0;
break;
+ case 'q':
+ quiet = 1;
+ break;
default:
usage();
} ARGEND;
t@@ -2341,7 +2344,8 @@ main(int argc, char *argv[])
signal(SIGTERM, initshutdown);
signal(SIGPIPE, SIG_IGN);
- printrat();
+ if (!quiet)
+ printrat();
toxinit();
localinit();
friendload();