* Added clicon_handle as parameter to all validate functions
* Added libxml2 XSD regexp mode as alternative to posix translation * Added `CLICON_YANG_REGEXP` option with possible values libxml2 and posix
This commit is contained in:
parent
69f2eb30f1
commit
a804e05375
27 changed files with 501 additions and 289 deletions
|
|
@ -359,12 +359,18 @@ yang2cli_var_sub(clicon_handle h,
|
|||
goto done;
|
||||
}
|
||||
if (options & YANG_OPTIONS_PATTERN){
|
||||
char *posix = NULL;
|
||||
if (regexp_xsd2posix(pattern, &posix) < 0)
|
||||
goto done;
|
||||
cprintf(cb, " regexp:\"%s\"", posix);
|
||||
if (posix)
|
||||
free(posix);
|
||||
char *mode;
|
||||
mode = clicon_yang_regexp(h);
|
||||
if (strcmp(mode, "posix") == 0){
|
||||
char *posix = NULL;
|
||||
if (regexp_xsd2posix(pattern, &posix) < 0)
|
||||
goto done;
|
||||
cprintf(cb, " regexp:\"%s\"", posix);
|
||||
if (posix)
|
||||
free(posix);
|
||||
}
|
||||
else
|
||||
cprintf(cb, " regexp:\"%s\"", pattern);
|
||||
}
|
||||
cprintf(cb, ">");
|
||||
if (helptext)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue