* Auto-cli changed singature of yang2cli()
* Auto-cli: create generated CLI for sub-parts of a YANG spec
This commit is contained in:
parent
f69daf773e
commit
dda3244252
9 changed files with 282 additions and 126 deletions
|
|
@ -50,7 +50,7 @@
|
|||
#include <cligen/cligen.h>
|
||||
#include <clixon/clixon.h>
|
||||
#include <clixon/clixon_cli.h>
|
||||
|
||||
#include <clixon/cli_generate.h>
|
||||
|
||||
/*! Example cli function */
|
||||
int
|
||||
|
|
@ -132,10 +132,24 @@ example_client_rpc(clicon_handle h,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/* Plugin start
|
||||
* Example on creating a generated tree from a sub-part of a yang spec.
|
||||
* which can then be used in a clispec as: @datamodelexample.
|
||||
* @see test_cli_gen_sub.sh
|
||||
* @note still experimental
|
||||
*/
|
||||
int
|
||||
example_start(clicon_handle h)
|
||||
{
|
||||
if (yang2cli_sub(h, "/example2:table/parameter=abc", "datamodelexample", 1, 0) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static clixon_plugin_api api = {
|
||||
"example", /* name */
|
||||
clixon_plugin_init, /* init */
|
||||
NULL, /* start */
|
||||
example_start, /* start */
|
||||
NULL, /* exit */
|
||||
.ca_prompt=NULL, /* cli_prompthook_t */
|
||||
.ca_suspend=NULL, /* cligen_susp_cb_t */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue