Imported Upstream version 1.8.0
[platform/core/ml/nnfw.git] / compiler / tflite2circle / driver / Driver.cpp
index 67b8e33..2f11e0a 100644 (file)
 #include "CircleModel.h"
 #include "TFLModel.h"
 
+#include <vconone/vconone.h>
+
+void print_version(void)
+{
+  std::cout << "tflite2circle version " << vconone::get_string() << std::endl;
+  std::cout << vconone::get_copyright() << std::endl;
+}
+
 int entry(int argc, char **argv)
 {
   arser::Arser arser{"tflite2circle is a Tensorflow lite to circle model converter"};
 
+  arser.add_argument("--version")
+      .nargs(0)
+      .required(false)
+      .default_value(false)
+      .help("Show version information and exit")
+      .exit_with(print_version);
+
   arser.add_argument("tflite")
       .nargs(1)
       .type(arser::DataType::STR)
@@ -42,7 +57,7 @@ int entry(int argc, char **argv)
   {
     std::cout << err.what() << std::endl;
     std::cout << arser;
-    return 0;
+    return 255;
   }
 
   std::string tfl_path = arser.get<std::string>("tflite");