yanglint REFACTOR print features in cmd_feature
diff --git a/tools/lint/cmd_feature.c b/tools/lint/cmd_feature.c
index a2ca07e..f3d784f 100644
--- a/tools/lint/cmd_feature.c
+++ b/tools/lint/cmd_feature.c
@@ -119,9 +119,6 @@
goto cleanup;
}
- /* always erase the set, so the previous module's features don't carry over to the next module's features */
- ly_set_erase(&set, NULL);
-
mod = ly_ctx_get_module_latest(*ctx, posv);
if (!mod) {
YLMSG_E("Module \"%s\" not found.\n", posv);
@@ -144,7 +141,9 @@
goto cleanup;
}
- print_features(yo->out, mod, &set);
+ if (yo->interactive) {
+ print_features(yo->out, mod, &set);
+ }
cleanup:
ly_set_erase(&set, NULL);