completing the function of hide for autocli-op in the yang files
This commit is contained in:
parent
33ad428854
commit
b0c5e43d50
4 changed files with 7 additions and 7 deletions
|
|
@ -521,10 +521,10 @@ cli_auto_show(clicon_handle h,
|
|||
switch (format){
|
||||
case FORMAT_XML:
|
||||
if (isroot)
|
||||
stdout(xp, 0, pretty, 1);
|
||||
xml2file(xp, 0, pretty, fprintf);
|
||||
else{
|
||||
while ((xc = xml_child_each(xp, xc, CX_ELMNT)) != NULL)
|
||||
stdout(xc, 0, pretty, 1);
|
||||
xml2file(xc, 0, pretty, fprintf);
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1043,7 +1043,7 @@ xmldb_put(clicon_handle h,
|
|||
if (xml2json(f, x0, pretty) < 0)
|
||||
goto done;
|
||||
}
|
||||
else if (clicon_xml2file(f, x0, 0, pretty, 0) < 0)
|
||||
else if (clicon_xml2file(f, x0, 0, pretty) < 0)
|
||||
goto done;
|
||||
/* Remove modules state after writing to file
|
||||
*/
|
||||
|
|
@ -1101,7 +1101,7 @@ xmldb_dump(clicon_handle h,
|
|||
if (xml2json(f, xt, pretty) < 0)
|
||||
goto done;
|
||||
}
|
||||
else if (clicon_xml2file(f, xt, 0, pretty, 0) < 0)
|
||||
else if (clicon_xml2file(f, xt, 0, pretty) < 0)
|
||||
goto done;
|
||||
retval = 0;
|
||||
done:
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@
|
|||
* @param[in] level how many spaces to insert before each line
|
||||
* @param[in] prettyprint insert \n and spaces tomake the xml more readable.
|
||||
* @param[in] fn Callback to make print function
|
||||
* @param[in] used_for_show_command is the function used for a cli show command.
|
||||
* @see clicon_xml2cbuf
|
||||
* One can use clicon_xml2cbuf to get common code, but using fprintf is
|
||||
* much faster than using cbuf and then printing that,...
|
||||
|
|
@ -114,6 +113,7 @@ xml2file_recurse(FILE *f,
|
|||
int haselement;
|
||||
char *val;
|
||||
char *encstr = NULL; /* xml encoded string */
|
||||
|
||||
if (x == NULL)
|
||||
goto ok;
|
||||
name = xml_name(x);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ main(int argc, char **argv)
|
|||
xpath = "/";
|
||||
if (xmldb_get(h, db, NULL, xpath, &xt) < 0)
|
||||
goto done;
|
||||
clicon_xml2file(stdout, xt, 0, 0, 0);
|
||||
clicon_xml2file(stdout, xt, 0, 0);
|
||||
fprintf(stdout, "\n");
|
||||
if (xt){
|
||||
xml_free(xt);
|
||||
|
|
@ -228,7 +228,7 @@ main(int argc, char **argv)
|
|||
clicon_err(OE_DB, 0, "xt is NULL");
|
||||
goto done;
|
||||
}
|
||||
clicon_xml2file(stdout, xt, 0, 0, 0);
|
||||
clicon_xml2file(stdout, xt, 0, 0);
|
||||
if (xt){
|
||||
xml_free(xt);
|
||||
xt = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue