Closed navaneethyv closed 1 year ago
Code explanation: in match_variable() here: https://github.com/clicon/cligen/blob/c450b310b0e149d29339cee2b6034f0fb05d90aa/cligen_match.c#L107 there is first a parsing into the base type (uint16) and then validation where extra ranges are checked:
cv_parse1(str, cv, reason);
cv_validate(h, cv, cs, co->co_command, reason);
In the example's first case for 2222
, the parsing succeeds but the validation fails.
In the second case for 22222222222
, the parsing fails.
Hmm. Would it make sense to parse every INT variant as uint64 and then feed a fixed INT
It is do-able but got somewhat complex
Fixed in cligen by parsing twice for int:s less than 64-bits. Eg:
Hi,
Please consider the following typedef.
The actual schema
When you cross the actual underlying type range, We see a different error.
The second error is not the most specific error. Can we print the most specific error when a range / typedef is present ?