Add better error checking for parsing program --array=1 2 3

This commit is contained in:
Bruce Hill 2025-03-02 01:11:57 -05:00
parent cb7a20117c
commit bd4ee6a429

View File

@ -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);