yanglint REFACTOR parsing of --in-format argument
diff --git a/tools/lint/yl_opt.c b/tools/lint/yl_opt.c
index d9bcbca..71492b2 100644
--- a/tools/lint/yl_opt.c
+++ b/tools/lint/yl_opt.c
@@ -218,6 +218,22 @@
     return 0;
 }
 
+int
+yo_opt_update_data_in_format(const char *arg, struct yl_opt *yo)
+{
+    if (!strcasecmp(arg, "xml")) {
+        yo->data_in_format = LYD_XML;
+    } else if (!strcasecmp(arg, "json")) {
+        yo->data_in_format = LYD_JSON;
+    } else if (!strcasecmp(arg, "lyb")) {
+        yo->data_in_format = LYD_LYB;
+    } else {
+        return 1;
+    }
+
+    return 0;
+}
+
 void
 free_cmdline(char *argv[])
 {