From 0622f758f742420ae8ef6c0cd3296c4ff40f89e0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 27 Sep 2024 13:56:56 -0400 Subject: Improved support for CLI arg parsing --- stdlib/stdlib.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'stdlib/stdlib.h') diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index 2037fae4..b8e78e9b 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -12,7 +12,15 @@ extern bool USE_COLOR; +typedef struct { + const char *name; + bool required; + const TypeInfo *type; + void *dest; +} cli_arg_t; + void tomo_init(void); +void tomo_parse_args(Text_t usage, Text_t help, int spec_len, cli_arg_t spec[spec_len], int argc, char *argv[]); __attribute__((format(printf, 1, 2))) _Noreturn void fail(const char *fmt, ...); __attribute__((format(printf, 4, 5))) -- cgit v1.2.3