Move ports around to allow master/server to coexist (#962).
[dcpomatic.git] / src / tools / dcpomatic_kdm_cli.cc
index f0097d7de38cd14b06256009d174ca60100f8a96..e06b9844bf2273850b645ce1cd0e2be6f98a994d 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;
@@ -295,21 +302,26 @@ int main (int argc, char* argv[])
                                );
 
                        if (zip) {
-                               CinemaKDMs::write_zip_files (
+                               int const N = CinemaKDMs::write_zip_files (
                                        CinemaKDMs::collect (screen_kdms),
                                        output,
+                                       Config::instance()->kdm_container_name_format(),
                                        Config::instance()->kdm_filename_format(),
-                                       values
+                                       values,
+                                       bind (&always_overwrite)
                                        );
 
                                if (verbose) {
-                                       cout << "Wrote ZIP files to " << output << "\n";
+                                       cout << "Wrote " << N << " ZIP files to " << output << "\n";
                                }
                        } else {
-                               ScreenKDM::write_files (screen_kdms, output, Config::instance()->kdm_filename_format(), values);
+                               int const N = ScreenKDM::write_files (
+                                       screen_kdms, output, Config::instance()->kdm_filename_format(), values,
+                                       bind (&always_overwrite)
+                                       );
 
                                if (verbose) {
-                                       cout << "Wrote KDM files to " << output << "\n";
+                                       cout << "Wrote " << N << " KDM files to " << output << "\n";
                                }
                        }
                } catch (FileError& e) {