summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorC. McEnroe2020-02-08 02:33:41 -0500
committerC. McEnroe2020-02-08 02:33:41 -0500
commit2cacf15314be31b33a61007ba6e063ced96c3d41 (patch)
treef1486130d1848f3da683fef0e0692f7bfe3e0795 /command.c
parent943502ea82b3965b4f652146ca03262ac6390f83 (diff)
Add /debug
Diffstat (limited to 'command.c')
-rw-r--r--command.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/command.c b/command.c
index e33c57e..1d1c756 100644
--- a/command.c
+++ b/command.c
@@ -23,6 +23,16 @@
 
 typedef void Command(size_t id, char *params);
 
+static void commandDebug(size_t id, char *params) {
+	(void)id;
+	(void)params;
+	self.debug ^= true;
+	uiFormat(
+		Debug, Warm, NULL,
+		"\3%dDebug is %s", Gray, (self.debug ? "on" : "off")
+	);
+}
+
 static void commandQuote(size_t id, char *params) {
 	(void)id;
 	if (params) ircFormat("%s\r\n", params);
@@ -116,6 +126,7 @@ static const struct Handler {
 	Command *fn;
 } Commands[] = {
 	{ "/close", commandClose },
+	{ "/debug", commandDebug },
 	{ "/join", commandJoin },
 	{ "/me", commandMe },
 	{ "/nick", commandNick },