diff options
Diffstat (limited to 'src/stdlib/cli.h')
| -rw-r--r-- | src/stdlib/cli.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/stdlib/cli.h b/src/stdlib/cli.h index 596409c1..5026edb3 100644 --- a/src/stdlib/cli.h +++ b/src/stdlib/cli.h @@ -9,17 +9,14 @@ typedef struct { const char *name; - char short_flag; - bool required; - const TypeInfo_t *type; void *dest; + const TypeInfo_t *type; + char short_flag; + bool required, populated; } cli_arg_t; -void _tomo_parse_args(int argc, char *argv[], Text_t usage, Text_t help, const char *version, int spec_len, - cli_arg_t spec[spec_len]); -#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__}) +void tomo_parse_args(int argc, char *argv[], Text_t usage, Text_t help, const char *version, int spec_len, + cli_arg_t spec[spec_len]); 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, bool allow_dashes); |
