* 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

@ -74,7 +74,7 @@ mycallback(clicon_handle h, cvec *cvv, cvec *argv)
nsc,
&xret) < 0)
goto done;
xml_print(stdout, xret);
clicon_xml2file_cb(stdout, xret, 0, 1, cligen_output);
retval = 0;
done:
if (nsc)
@ -117,11 +117,11 @@ example_client_rpc(clicon_handle h,
goto done;
}
/* Print result */
clicon_xml2file(stdout, xml_child_i(xret, 0), 0, 0);
clicon_xml2file_cb(stdout, xml_child_i(xret, 0), 0, 0, cligen_output);
fprintf(stdout,"\n");
/* pretty-print:
xml2txt(stdout, xml_child_i(xret, 0), 0);
xml2txt_cb(stdout, xml_child_i(xret, 0), cligen_output);
*/
retval = 0;
done: