schema printers FEATURE print compiled schema as YANG (LYS_OUT_YANG_COMPILED)
diff --git a/tools/lint/commands.c b/tools/lint/commands.c
index 0e7913a..bb6bf1b 100644
--- a/tools/lint/commands.c
+++ b/tools/lint/commands.c
@@ -346,13 +346,14 @@
int
cmd_print(const char *arg)
{
- int c, argc, option_index, ret = 1, tree_ll = 0, tree_opts = 0;
+ int c, argc, option_index, ret = 1, tree_ll = 0, tree_opts = 0, compiled = 0;
char **argv = NULL, *ptr, *model_name, *revision;
const char *out_path = NULL;
const struct lys_module *module;
LYS_OUTFORMAT format = LYS_OUT_TREE;
FILE *output = stdout;
static struct option long_options[] = {
+ {"compiled", no_argument, 0, 'c'},
{"help", no_argument, 0, 'h'},
{"format", required_argument, 0, 'f'},
{"output", required_argument, 0, 'o'},
@@ -386,12 +387,15 @@
optind = 0;
while (1) {
option_index = 0;
- c = getopt_long(argc, argv, "hf:go:guP:L:", long_options, &option_index);
+ c = getopt_long(argc, argv, "chf:go:guP:L:", long_options, &option_index);
if (c == -1) {
break;
}
switch (c) {
+ case 'c':
+ compiled = 1;
+ break;
case 'h':
cmd_print_help();
ret = 0;
@@ -453,6 +457,11 @@
goto cleanup;
}
+ /* compiled format */
+ if (compiled) {
+ format++;
+ }
+
/* tree fromat with or without gropings */
if ((tree_opts || tree_ll) && format != LYS_OUT_TREE) {
fprintf(stderr, "--tree options take effect only in case of the tree output format.\n");