@@ -8,9 +8,9 @@ /* input types */ typedef struct kcli_opt { - codepoint id; + rune id; const char* name; enum kcli_opt_kind { kcli_opt_none /* flag is disabled and hidden */, kcli_opt_string /* flag takes a string argument */, @@ -49,11 +49,14 @@ kcli_param_hex = kcli_param_int | 16, } kind; enum kcli_rule { kcli_rule_forbidden, - kcli_rule_optional, kcli_rule_required, + kcli_rule_optional, + kcli_rule_overflow, } rule; + void* val; + const char* desc; } kcli_param; typedef struct kcli_set { const char* name; @@ -71,8 +74,9 @@ kcli_cond_extra /* parse succeded, but arguments or flags were left over */, kcli_cond_fail /* unspecified error */, kcli_cond_parse /* bad syntax, parse failed */, + kcli_cond_overlong /* a string in the configuration structures is longer than allowed */, } kcli_cond; typedef enum kcli_flag { kcli_flag_off = 0,