about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--catgirl.14
-rw-r--r--command.c11
2 files changed, 15 insertions, 0 deletions
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 <debug>
+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 },
this is simpler. 2019-02-10Remove pattend from hiJune McEnroe 2019-02-10Replace uses of pattend with newline patternsJune McEnroe 2019-02-10Add hi debug outputJune McEnroe 2019-02-10Actually do HTML &quot; escapingJune McEnroe 2019-02-10Set git commit.verboseJune McEnroe 2019-02-10Add back missing static keywordJune McEnroeer.sh?id=480a5024344b5e5b3562c3d663206fc372235510&follow=1'>Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe 2019-12-16Post "cgit setup"June McEnroe