* New YANG generated auto-cli feature with syntax modes

* The existing autocli does not support modes, complete paths must be given, eg: `set a b c d 42`.
  * In the new auto-cli, automatic modes are present at each YANG syntax node level, eg the above can be given as: `edit a b c; set d 4; top`
  * The existing CLI API remains, the new API is as follows: `cli_auto_edit()`, `cli_auto_up()`, `cli_auto_top()`, `cli_auto_show()`, `cli_auto_set()`, `cli_auto_merge()`, `cli_auto_create()`, `cli_auto_del()`.
  * See `test/test_cli_auto.sh` for an example of the new API, and `apps/cli/cli_auto.c` for the source code of the new callback API.
  * Documentation will be appear and full integration with the main example.
* Added inline state field to clixon-example.yang
* Added new clicon_data_cvec_*() API for generic cvec structs
This commit is contained in:
Olof hagsand 2020-10-14 10:54:10 +02:00
parent 8d901e1fde
commit 2d56c9674a
11 changed files with 972 additions and 12 deletions

View file

@ -71,6 +71,8 @@ int cli_notification_register(clicon_handle h, char *stream, enum format_enum fo
int cli_dbxml(clicon_handle h, cvec *vars, cvec *argv, enum operation_type op, cvec *nsctx);
int cli_dbxml(clicon_handle h, cvec *vars, cvec *argv, enum operation_type op, cvec *nsctx);
int cli_set(clicon_handle h, cvec *vars, cvec *argv);
int cli_merge(clicon_handle h, cvec *vars, cvec *argv);
@ -137,4 +139,15 @@ int cli_show_auto_state(clicon_handle h, cvec *cvv, cvec *argv);
int cli_show_options(clicon_handle h, cvec *cvv, cvec *argv);
/* cli_auto.c: Autocli mode support */
int cli_auto_edit(clicon_handle h, cvec *cvv1, cvec *argv);
int cli_auto_up(clicon_handle h, cvec *cvv, cvec *argv);
int cli_auto_top(clicon_handle h, cvec *cvv, cvec *argv);
int cli_auto_show(clicon_handle h, cvec *cvv, cvec *argv);
int cli_auto_set(clicon_handle h, cvec *cvv, cvec *argv);
int cli_auto_merge(clicon_handle h, cvec *cvv, cvec *argv);
int cli_auto_create(clicon_handle h, cvec *cvv, cvec *argv);
int cli_auto_del(clicon_handle h, cvec *cvv, cvec *argv);
#endif /* _CLIXON_CLI_API_H_ */