yanglint REFACTOR parsing of --format argument
diff --git a/tools/lint/cmd_print.c b/tools/lint/cmd_print.c
index a6b815a..efbf9eb 100644
--- a/tools/lint/cmd_print.c
+++ b/tools/lint/cmd_print.c
@@ -92,16 +92,7 @@
break;
case 'f': /* --format */
- if (!strcasecmp(optarg, "yang")) {
- yo->schema_out_format = LYS_OUT_YANG;
- } else if (!strcasecmp(optarg, "yin")) {
- yo->schema_out_format = LYS_OUT_YIN;
- } else if (!strcasecmp(optarg, "info")) {
- yo->schema_out_format = LYS_OUT_YANG_COMPILED;
- } else if (!strcasecmp(optarg, "tree")) {
- yo->schema_out_format = LYS_OUT_TREE;
- } else {
- YLMSG_E("Unknown output format %s\n", optarg);
+ if (yl_opt_update_schema_out_format(optarg, yo)) {
cmd_print_help();
return 1;
}