Add /debug

weechat-hashes
C. McEnroe 2020-02-08 02:33:41 -05:00
parent 943502ea82
commit 2cacf15314
2 changed files with 15 additions and 0 deletions

View File

@ -148,6 +148,10 @@ Send a raw IRC command.
.Bl -tag -width Ds .Bl -tag -width Ds
.It Ic /close Op Ar name | num .It Ic /close Op Ar name | num
Close the named, numbered or current window. Close the named, numbered or current window.
.It Ic /debug
Toggle logging in the
.Sy <debug>
window.
.It Ic /window Ar name .It Ic /window Ar name
Switch to window by name. Switch to window by name.
.It Ic /window Ar num , Ic / Ns Ar num .It Ic /window Ar num , Ic / Ns Ar num

View File

@ -23,6 +23,16 @@
typedef void Command(size_t id, char *params); 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) { static void commandQuote(size_t id, char *params) {
(void)id; (void)id;
if (params) ircFormat("%s\r\n", params); if (params) ircFormat("%s\r\n", params);
@ -116,6 +126,7 @@ static const struct Handler {
Command *fn; Command *fn;
} Commands[] = { } Commands[] = {
{ "/close", commandClose }, { "/close", commandClose },
{ "/debug", commandDebug },
{ "/join", commandJoin }, { "/join", commandJoin },
{ "/me", commandMe }, { "/me", commandMe },
{ "/nick", commandNick }, { "/nick", commandNick },