From 6d4af711c1d18885c94d73110d787c503ebac076 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 18 Oct 2025 14:29:42 -0400 Subject: Overhaul of CLI arg parsing logic --- src/stdlib/cli.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/stdlib/cli.h') diff --git a/src/stdlib/cli.h b/src/stdlib/cli.h index a2058754..8f9e2a9c 100644 --- a/src/stdlib/cli.h +++ b/src/stdlib/cli.h @@ -9,6 +9,7 @@ typedef struct { const char *name; + char short_flag; bool required; const TypeInfo_t *type; void *dest; @@ -19,3 +20,6 @@ void _tomo_parse_args(int argc, char *argv[], Text_t usage, Text_t help, const c #define tomo_parse_args(argc, argv, usage, help, version, ...) \ _tomo_parse_args(argc, argv, usage, help, version, sizeof((cli_arg_t[]){__VA_ARGS__}) / sizeof(cli_arg_t), \ (cli_arg_t[]){__VA_ARGS__}) + +bool pop_cli_flag(List_t *args, char short_flag, const char *flag, void *dest, const TypeInfo_t *type); +bool pop_cli_positional(List_t *args, const char *flag, void *dest, const TypeInfo_t *type); -- cgit v1.2.3