completing the function of hide for autocli-op in the yang files
This commit is contained in:
parent
8ca5944111
commit
c370ac8706
16 changed files with 98 additions and 44 deletions
|
|
@ -119,7 +119,14 @@ cli_expand_var_generate(clicon_handle h,
|
|||
cbuf *cb)
|
||||
{
|
||||
int retval = -1;
|
||||
char *api_path_fmt = NULL;
|
||||
char *api_path_fmt = NULL, *opext = NULL;
|
||||
|
||||
if (yang_extension_value(ys, "autocli-op", CLIXON_LIB_NS, &opext) < 0)
|
||||
goto done;
|
||||
if (opext && strcmp(opext, "hide-database") == 0) {
|
||||
retval = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (yang2api_path_fmt(ys, 1, &api_path_fmt) < 0)
|
||||
goto done;
|
||||
|
|
@ -574,7 +581,7 @@ yang2cli_var(clicon_handle h,
|
|||
uint8_t fraction_digits = 0;
|
||||
enum cv_type cvtype;
|
||||
int options = 0;
|
||||
int completionp;
|
||||
int completionp, result;
|
||||
char *type;
|
||||
|
||||
if ((patterns = cvec_new(0)) == NULL){
|
||||
|
|
@ -599,9 +606,10 @@ yang2cli_var(clicon_handle h,
|
|||
if (yang2cli_var_union(h, ys, origtype, yrestype, helptext, cb) < 0)
|
||||
goto done;
|
||||
if (clicon_cli_genmodel_completion(h)){
|
||||
if (cli_expand_var_generate(h, ys, cvtype,
|
||||
result = cli_expand_var_generate(h, ys, cvtype,
|
||||
options, fraction_digits,
|
||||
cb) < 0)
|
||||
cb);
|
||||
if (result < 0)
|
||||
goto done;
|
||||
yang2cli_helptext(cb, helptext);
|
||||
}
|
||||
|
|
@ -622,9 +630,10 @@ yang2cli_var(clicon_handle h,
|
|||
options, cvv, patterns, fraction_digits, cb)) < 0)
|
||||
goto done;
|
||||
if (completionp){
|
||||
if (cli_expand_var_generate(h, ys, cvtype,
|
||||
result = cli_expand_var_generate(h, ys, cvtype,
|
||||
options, fraction_digits,
|
||||
cb) < 0)
|
||||
cb);
|
||||
if (result < 0)
|
||||
goto done;
|
||||
yang2cli_helptext(cb, helptext);
|
||||
cprintf(cb, ")");
|
||||
|
|
@ -688,6 +697,10 @@ yang2cli_leaf(clicon_handle h,
|
|||
cprintf(cb, ",hide{");
|
||||
extralevel = 1;
|
||||
}
|
||||
if (opext && strcmp(opext, "hide-database-auto-completion") == 0){
|
||||
cprintf(cb, ",hide-database-auto-completion{");
|
||||
extralevel = 1;
|
||||
}
|
||||
if (yang2cli_var(h, ys, helptext, cb) < 0)
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -695,6 +708,9 @@ yang2cli_leaf(clicon_handle h,
|
|||
if (opext && strcmp(opext, "hide") == 0){
|
||||
cprintf(cb, ",hide");
|
||||
}
|
||||
if (opext && strcmp(opext, "hide-database-auto-completion") == 0){
|
||||
cprintf(cb, ",hide-database-auto-completion");
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
|
@ -767,6 +783,9 @@ yang2cli_container(clicon_handle h,
|
|||
if (opext != NULL && strcmp(opext, "hide") == 0){
|
||||
cprintf(cb, ",hide");
|
||||
}
|
||||
if (opext != NULL && strcmp(opext, "hide-database-auto-completion") == 0){
|
||||
cprintf(cb, ",hide-database-auto-completion");
|
||||
}
|
||||
cprintf(cb, ";{\n");
|
||||
}
|
||||
|
||||
|
|
@ -822,6 +841,10 @@ yang2cli_list(clicon_handle h,
|
|||
cprintf(cb, ",hide");
|
||||
extralevel = 1;
|
||||
}
|
||||
if (opext != NULL && strcmp(opext, "hide-database-auto-completion") == 0){
|
||||
cprintf(cb, ",hide-database-auto-completion");
|
||||
extralevel = 1;
|
||||
}
|
||||
if ((yd = yang_find(ys, Y_DESCRIPTION, NULL)) != NULL){
|
||||
if ((helptext = strdup(yang_argument_get(yd))) == NULL){
|
||||
clicon_err(OE_UNIX, errno, "strdup");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue