From f7f5acbbe2a848d2c827aed0fe8410e48300c1e9 Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Fri, 2 Oct 2020 19:38:37 -0400 Subject: Double up /help for server help While the automatic search via LESS is neat, I don't think it's very useful. Just always open the manual to the COMMANDS section, and fix it to append to LESS rather than replace it. --- command.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index 92f1271..3af1246 100644 --- a/command.c +++ b/command.c @@ -421,14 +421,20 @@ static void commandExec(uint id, char *params) { static void commandHelp(uint id, char *params) { (void)id; - uiHide(); + if (params) { + ircFormat("HELP :%s\r\n", params); + replies.help++; + return; + } + + uiHide(); pid_t pid = fork(); if (pid < 0) err(EX_OSERR, "fork"); if (pid) return; char buf[256]; - snprintf(buf, sizeof(buf), "ip%s$", (params ?: "COMMANDS")); + snprintf(buf, sizeof(buf), "%spCOMMANDS$", (getenv("LESS") ?: "")); setenv("LESS", buf, 1); execlp("man", "man", "1", "catgirl", NULL); dup2(utilPipe[1], STDERR_FILENO); -- cgit 1.4.1-2-gfad0