Use GetCommandLineW() to get a UTF16-encoded command line on Windows (#2248).
[dcpomatic.git] / src / tools / dcpomatic_kdm_cli.cc
index 9c8c16aef49b72584d7fe0fb7cf78fc171e28821..1db5ce7f93ecf6968f481c7e4849e63a37037455 100644 (file)
  */
 
 
+#include "lib/cross.h"
 #include "lib/kdm_cli.h"
+#include "lib/util.h"
+#include <iostream>
 
 
 int
 main (int argc, char* argv[])
 {
-       return kdm_cli (argc, argv);
+       ArgFixer fixer(argc, argv);
+
+       dcpomatic_setup_path_encoding ();
+       dcpomatic_setup ();
+
+       auto error = kdm_cli (fixer.argc(), fixer.argv(), [](std::string s) { std::cout << s << "\n"; });
+       if (error) {
+               std::cerr << *error << "\n";
+               exit (EXIT_FAILURE);
+       }
+
+       return 0;
 }