From 2cacf15314be31b33a61007ba6e063ced96c3d41 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 8 Feb 2020 02:33:41 -0500 Subject: Add /debug --- catgirl.1 | 4 ++++ command.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/catgirl.1 b/catgirl.1 index 9314e7a..3f8131f 100644 --- a/catgirl.1 +++ b/catgirl.1 @@ -148,6 +148,10 @@ Send a raw IRC command. .Bl -tag -width Ds .It Ic /close Op Ar name | num Close the named, numbered or current window. +.It Ic /debug +Toggle logging in the +.Sy +window. .It Ic /window Ar name Switch to window by name. .It Ic /window Ar num , Ic / Ns Ar num 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 }, -- cgit 1.4.1