Documented Clixon CLIgen usage and extensions

This commit is contained in:
Olof hagsand 2019-02-13 15:20:42 +01:00
parent ea8c84a372
commit 54626aaae4
4 changed files with 135 additions and 53 deletions

View file

@ -307,3 +307,16 @@ clixon_plugin_init(clicon_handle h)
return &api; /* Return NULL on error */
}
```
Here is a corresponding example for a CLI plugin:
```
static clixon_plugin_api api = {
"example", /* name */
clixon_plugin_init, /* init */
NULL, /* start */
NULL, /* exit */
.ca_prompt=NULL, /* cli_prompthook_t */
.ca_suspend=NULL, /* cligen_susp_cb_t */
.ca_interrupt=NULL, /* cligen_interrupt_cb_t */
};
```

View file

@ -40,7 +40,7 @@ show("Show a particular state of the system"){
}
configuration("Show configuration"), cli_show_config("candidate", "text", "/");{
xml("Show configuration as XML"), cli_show_config("candidate", "xml", "/");{
@datamodel, cli_show_auto("candidate", "text");
@datamodel, cli_show_auto("candidate", "xml");
}
cli("Show configuration as CLI commands"), cli_show_config("candidate", "cli", "/");{
@datamodel, cli_show_auto("candidate", "cli");