about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-10-02 19:38:37 -0400
committerJune McEnroe <june@causal.agency>2020-10-02 19:38:37 -0400
commitf7f5acbbe2a848d2c827aed0fe8410e48300c1e9 (patch)
treea4967b2ac419cfde81a951b65e47fde6481d6db9 /command.c
parentUse WHO for /ops (diff)
downloadcatgirl-f7f5acbbe2a848d2c827aed0fe8410e48300c1e9.tar.gz
catgirl-f7f5acbbe2a848d2c827aed0fe8410e48300c1e9.zip
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.
Diffstat (limited to '')
-rw-r--r--command.c10
1 files changed, 8 insertions, 2 deletions
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);
>2019-11-08Check that password is hashedJune McEnroe 2019-11-08Avoid calling getopt_long again after it returns -1June McEnroe 2019-11-08Only change AWAY status for registered clientsJune McEnroe 2019-11-07Just write the example normallyJune McEnroe 2019-11-07Include path in readlinkat errorJune McEnroe 2019-11-07Call clientConsume before clientRecvJune McEnroe 2019-11-06Use -l:filename in Linux.mkJune McEnroe 2019-11-06Fix compat.h for #defined strlcpyJune McEnroe 2019-11-06Allow unsetting LIBRESSL_PREFIXJune McEnroe 2019-11-06Document calico service configurationJune McEnroe 2019-11-06Document SASL EXTERNAL configuration in more detailJune McEnroe 2019-11-06Document pounce service configurationJune McEnroe 2019-11-06Mention Darwin and GNU/Linux in READMEJune McEnroe 2019-11-06Assume LibreSSL from brew on DarwinJune McEnroe 2019-11-06Remove -DNO_EXPLICIT_BZERO from Darwin.mkJune McEnroe 2019-11-06Don't install rc scripts or dirs on LinuxJune McEnroe