aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-07 12:26:22 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-03-07 12:26:22 -0500
commit3ea8540ec6ea689cc36a2b134879bd14c11888e0 (patch)
tree0acf71e96e957ed2ae98346e5fd9ef9e58dcb9f8
parent1c909015534ac9e94d48d1fe61febb6299ba3da6 (diff)
Incremental improvement to parsing `none` for optional arguments
-rw-r--r--stdlib/stdlib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c
index efee2a05..bf17aaf4 100644
--- a/stdlib/stdlib.c
+++ b/stdlib/stdlib.c
@@ -72,6 +72,9 @@ static bool parse_single_arg(const TypeInfo_t *info, char *arg, void *dest)
{
if (!arg) return false;
+ if (info->tag == OptionalInfo && streq(arg, "none"))
+ return true;
+
while (info->tag == OptionalInfo)
info = info->OptionalInfo.type;