* Added new cli show functions to work with cligen_output for cligen pageing to work. To acheive this, add a callback function as follows:

* xml2txt(...) --> xml2txt_cb(..., cligen_output)
  * xml2cli(...) --> xml2cli_cb(..., cligen_output)
  * clicon_xml2file(...) --> clicon_xml2file_cb(..., cligen_output)
  * xml2json(...) --> xml2json_cb(..., cligen_output)
  * yang_print(...) --> yang_print_cb(..., cligen_output)
This commit is contained in:
Olof hagsand 2020-06-17 14:04:19 +02:00
parent 6e714beea5
commit 0adcd94f3f
13 changed files with 291 additions and 114 deletions

View file

@ -652,10 +652,10 @@ compare_xmls(cxobj *xc1,
xc = NULL;
if (astext)
while ((xc = xml_child_each(xc1, xc, -1)) != NULL)
xml2txt(f, xc, 0);
xml2txt_cb(f, xc, cligen_output);
else
while ((xc = xml_child_each(xc1, xc, -1)) != NULL)
xml_print(f, xc);
clicon_xml2file_cb(f, xc, 0, 1, cligen_output);
fclose(f);
close(fd);
@ -669,10 +669,10 @@ compare_xmls(cxobj *xc1,
xc = NULL;
if (astext)
while ((xc = xml_child_each(xc2, xc, -1)) != NULL)
xml2txt(f, xc, 0);
xml2txt_cb(f, xc, cligen_output);
else
while ((xc = xml_child_each(xc2, xc, -1)) != NULL)
xml_print(f, xc);
clicon_xml2file_cb(f, xc, 0, 1, cligen_output);
fclose(f);
close(fd);
@ -1002,15 +1002,15 @@ cli_notification_cb(int s,
while ((x = xml_child_each(xe, x, -1)) != NULL) {
switch (format){
case FORMAT_XML:
if (clicon_xml2file(stdout, x, 0, 1) < 0)
if (clicon_xml2file_cb(stdout, x, 0, 1, cligen_output) < 0)
goto done;
break;
case FORMAT_TEXT:
if (xml2txt(stdout, x, 0) < 0)
if (xml2txt_cb(stdout, x, cligen_output) < 0)
goto done;
break;
case FORMAT_JSON:
if (xml2json(stdout, x, 1) < 0)
if (xml2json_cb(stdout, x, 1, cligen_output) < 0)
goto done;
break;
default: