about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--catgirl.14
-rw-r--r--chat.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/catgirl.1 b/catgirl.1
index 5412a52..213b504 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -15,7 +15,7 @@
 .Op Fl N Ar notify
 .Op Fl O Ar open
 .Op Fl S Ar bind
-.Op Fl T Ar timestamp
+.Op Fl T Ns Op Ar timestamp
 .Op Fl a Ar plain
 .Op Fl c Ar cert
 .Op Fl h Ar host
@@ -188,7 +188,7 @@ Bind to source address
 .Ar host
 when connecting to the server.
 .
-.It Fl T Ar format | Cm timestamp Op = Ar format
+.It Fl T Ns Oo Ar format Oc | Cm timestamp Op = Ar format
 Show timestamps by default,
 in the specified
 .Xr strftime 3
diff --git a/chat.c b/chat.c
index 3f6aa71..09d0ca6 100644
--- a/chat.c
+++ b/chat.c
@@ -190,10 +190,11 @@ int main(int argc, char *argv[]) {
 		{ .val = 'w', .name = "pass", required_argument },
 		{0},
 	};
-	char opts[2 * ARRAY_LEN(options)];
+	char opts[3 * ARRAY_LEN(options)];
 	for (size_t i = 0, j = 0; i < ARRAY_LEN(options); ++i) {
 		opts[j++] = options[i].val;
-		if (options[i].has_arg) opts[j++] = ':';
+		if (options[i].has_arg != no_argument) opts[j++] = ':';
+		if (options[i].has_arg == optional_argument) opts[j++] = ':';
 	}
 
 	for (int opt; 0 < (opt = getopt_config(argc, argv, opts, options, NULL));) {
td colspan='3' class='logmsg'> 2019-11-09Define macro for bit flag enumsJune McEnroe 2019-11-08Check that password is hashedJune McEnroe 2019-11-08Avoid calling getopt_long again after it returns -1June McEnroe On GNU, calling getopt_long again will reset optind back to the first non-option argument, which would cause an infinite loop of reading the same configurtion file forever. 2019-11-08Only change AWAY status for registered clientsJune McEnroe Turns out I did eventually fix this, because I may want to implement "passive clients" for logging or notification stuff, which wouldn't affect AWAY status either. 2019-11-07Just write the example normallyJune McEnroe 2019-11-07Include path in readlinkat errorJune McEnroe 2019-11-07Call clientConsume before clientRecvJune McEnroe This might reduce the frequency of a client getting its own message back because it was behind in the ring when it sent it. 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