Confirm overwrite of KDMs (#1008).
[dcpomatic.git] / src / tools / dcpomatic_kdm_cli.cc
index f0097d7de38cd14b06256009d174ca60100f8a96..7cfcaa1712b50a39f645dc266518cf950e0fdf22 100644 (file)
@@ -40,6 +40,7 @@ using std::list;
 using std::vector;
 using boost::shared_ptr;
 using boost::optional;
+using boost::bind;
 
 static void
 help ()
@@ -106,6 +107,12 @@ duration_from_string (string d)
        exit (EXIT_FAILURE);
 }
 
+static bool
+always_overwrite ()
+{
+       return true;
+}
+
 int main (int argc, char* argv[])
 {
        boost::filesystem::path output;
@@ -306,7 +313,10 @@ int main (int argc, char* argv[])
                                        cout << "Wrote ZIP files to " << output << "\n";
                                }
                        } else {
-                               ScreenKDM::write_files (screen_kdms, output, Config::instance()->kdm_filename_format(), values);
+                               ScreenKDM::write_files (
+                                       screen_kdms, output, Config::instance()->kdm_filename_format(), values,
+                                       bind (&always_overwrite)
+                                       );
 
                                if (verbose) {
                                        cout << "Wrote KDM files to " << output << "\n";