* Experimental text syntax parser/loader

* Added new text syntax parsing and loading from CLI
  * Unified text output functions to `xml2txt` and moved to clixon_text_syntax.[ch]
    * The following are removed: `cli_xml2txt` and `xml2txt_cb`
  * Text output format changed:
    * Namespace/modulename added to top-level
  * See [Support performant load_config_file(...) for TEXT format](https://github.com/clicon/clixon/issues/324)
This commit is contained in:
Olof hagsand 2022-05-19 12:56:44 +02:00
parent 43a57dad79
commit 2ece0b8f51
29 changed files with 1140 additions and 238 deletions

View file

@ -122,7 +122,7 @@ example_client_rpc(clicon_handle h,
fprintf(stdout,"\n");
/* pretty-print:
xml2txt_cb(stdout, xml_child_i(xret, 0), cligen_output);
xml2txt(xml_child_i(xret, 0), cligen_output, stdout, 0);
*/
retval = 0;
done:

View file

@ -111,11 +111,13 @@ load("Load configuration from XML file") <filename:string>("Filename (local file
cli("Replace candidate with file containing CLI commands"), load_config_file("","filename", "replace", "cli");
xml("Replace candidate with file containing XML"), load_config_file("","filename", "replace", "xml");
json("Replace candidate with file containing JSON"), load_config_file("","filename", "replace", "json");
text("Replace candidate with file containing TEXT"), load_config_file("","filename", "replace", "text");
}
merge("Merge file with existent candidate"), load_config_file("filename", "merge");{
cli("Merge candidate with file containing CLI commands"), load_config_file("","filename", "merge", "cli");
xml("Merge candidate with file containing XML"), load_config_file("","filename", "merge", "xml");
json("Merge candidate with file containing JSON"), load_config_file("","filename", "merge", "json");
text("Merge candidate with file containing TEXT"), load_config_file("","filename", "merge", "text");
}
}
example("This is a comment") <var:int32>("Just a random number"), mycallback("myarg");