diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-27 13:56:56 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-27 13:56:56 -0400 |
| commit | 0622f758f742420ae8ef6c0cd3296c4ff40f89e0 (patch) | |
| tree | 8064ca70a40c45fb70f21bbfc5a4a3e750e0da9c /stdlib/stdlib.h | |
| parent | b138893c40882f258176fae5c68fc7538587629c (diff) | |
Improved support for CLI arg parsing
Diffstat (limited to 'stdlib/stdlib.h')
| -rw-r--r-- | stdlib/stdlib.h | 8 |
1 files changed, 8 insertions, 0 deletions
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))) |
