diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-02 01:11:57 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-02 01:11:57 -0500 |
| commit | bd4ee6a429c1158bd82dad6ec151e6ba0065c822 (patch) | |
| tree | f7005960a72f8570487ec4201b673b4c097ce725 /stdlib/stdlib.c | |
| parent | cb7a20117c441c63f46bb4703f1908c3c07d95cb (diff) | |
Add better error checking for parsing `program --array=1 2 3`
Diffstat (limited to 'stdlib/stdlib.c')
| -rw-r--r-- | stdlib/stdlib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c index cc549899..64f3555f 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); |
