completing the function of hide for autocli-op in the yang files
This commit is contained in:
parent
3736927efa
commit
33ad428854
14 changed files with 153 additions and 59 deletions
|
|
@ -836,7 +836,16 @@ yang2cli_list(clicon_handle h,
|
|||
char *opext = NULL;
|
||||
|
||||
cprintf(cb, "%*s%s", level*3, "", yang_argument_get(ys));
|
||||
/* Look for autocli-op defined in clixon-lib.yang */
|
||||
if ((yd = yang_find(ys, Y_DESCRIPTION, NULL)) != NULL){
|
||||
if ((helptext = strdup(yang_argument_get(yd))) == NULL){
|
||||
clicon_err(OE_UNIX, errno, "strdup");
|
||||
goto done;
|
||||
}
|
||||
if ((s = strstr(helptext, "\n\n")) != NULL)
|
||||
*s = '\0';
|
||||
yang2cli_helptext(cb, helptext);
|
||||
}
|
||||
/* Look for autocli-op defined in clixon-lib.yang */
|
||||
if (yang_extension_value(ys, "autocli-op", CLIXON_LIB_NS, &opext) < 0)
|
||||
goto done;
|
||||
if (opext != NULL && strcmp(opext, "hide") == 0){
|
||||
|
|
@ -847,15 +856,6 @@ yang2cli_list(clicon_handle h,
|
|||
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");
|
||||
goto done;
|
||||
}
|
||||
if ((s = strstr(helptext, "\n\n")) != NULL)
|
||||
*s = '\0';
|
||||
yang2cli_helptext(cb, helptext);
|
||||
}
|
||||
/* Loop over all key variables */
|
||||
cvk = yang_cvec_get(ys); /* Use Y_LIST cache, see ys_populate_list() */
|
||||
cvi = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue