From bd4ee6a429c1158bd82dad6ec151e6ba0065c822 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 2 Mar 2025 01:11:57 -0500 Subject: [PATCH] Add better error checking for parsing `program --array=1 2 3` --- stdlib/stdlib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c index cc54989..64f3555 100644 --- a/stdlib/stdlib.c +++ b/stdlib/stdlib.c @@ -164,6 +164,10 @@ static bool parse_single_arg(const TypeInfo_t *info, char *arg, void *dest) Text_t t = generic_as_text(NULL, false, info); errx(1, "Unsupported multi-argument struct type for argument parsing: %k", &t); + } else if (info->tag == ArrayInfo) { + errx(1, "Array arguments must be specified as `--flag ...` not `--flag=...`"); + } else if (info->tag == TableInfo) { + errx(1, "Table arguments must be specified as `--flag ...` not `--flag=...`"); } else { Text_t t = generic_as_text(NULL, false, info); errx(1, "Unsupported type for argument parsing: %k", &t);