diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-18 14:29:42 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-18 14:29:42 -0400 |
| commit | 6d4af711c1d18885c94d73110d787c503ebac076 (patch) | |
| tree | 0f0e0fc60915d2c26ec97eca985fe1e418e6c4a9 /src/stdlib/cli.h | |
| parent | 5a26b365fc732c0873474371880b43fc9e843e4b (diff) | |
Overhaul of CLI arg parsing logic
Diffstat (limited to 'src/stdlib/cli.h')
| -rw-r--r-- | src/stdlib/cli.h | 4 |
1 files changed, 4 insertions, 0 deletions
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); |
