yanglint REFACTOR check parameters for cmd print
diff --git a/tools/lint/cmd_print.c b/tools/lint/cmd_print.c
index 37fe3f0..2f46c51 100644
--- a/tools/lint/cmd_print.c
+++ b/tools/lint/cmd_print.c
@@ -140,14 +140,13 @@
cmd_print_dep(struct yl_opt *yo, int posc)
{
/* file name */
- if (!posc && !yo->schema_node_path) {
+ if (yo->interactive && !posc && !yo->schema_node_path) {
YLMSG_E("Missing the name of the module to print.\n");
return 1;
}
if ((yo->schema_out_format != LYS_OUT_TREE) && yo->line_length) {
- YLMSG_E("--tree-line-length take effect only in case of the tree output format.\n");
- return 1;
+ YLMSG_W("--tree-line-length take effect only in case of the tree output format.\n");
}
if (!yo->out) {
diff --git a/tools/lint/main_ni.c b/tools/lint/main_ni.c
index 0b7494e..86696a6 100644
--- a/tools/lint/main_ni.c
+++ b/tools/lint/main_ni.c
@@ -761,9 +761,8 @@
if (cmd_data_dep(yo, 0)) {
return -1;
}
-
- if ((yo->schema_out_format != LYS_OUT_TREE) && yo->line_length) {
- YLMSG_W("--tree-line-length take effect only in case of the tree output format.\n");
+ if (cmd_print_dep(yo, 0)) {
+ return -1;
}
if (yo->schema_out_format == LYS_OUT_TREE) {