Use dcp::filesystem to wrap filesystem calls and fix_long_path
[dcpomatic.git] / src / tools / dcpomatic_cli.cc
index f4359ce86ddb3248b10782bee531608bd3bb7393..96bf830863f2b53266a34176357c8d29f97237fe 100644 (file)
@@ -39,6 +39,7 @@
 #include "lib/util.h"
 #include "lib/version.h"
 #include "lib/video_content.h"
+#include <dcp/filesystem.h>
 #include <dcp/version.h>
 #include <getopt.h>
 #include <iostream>
@@ -78,7 +79,7 @@ help (string n)
             << "      --no-check                    don't check project's content files for changes before making the DCP\n"
             << "      --export-format <format>      export project to a file, rather than making a DCP: specify mov or mp4\n"
             << "      --export-filename <filename>  filename to export to with --export-format\n"
-            << "      --hints                       show hints and stop if any are given\n"
+            << "      --hints                       analyze film for hints before encoding and abort if any are found\n"
             << "\n"
             << "<FILM> is the film directory.\n";
 }
@@ -442,7 +443,7 @@ main (int argc, char* argv[])
        for (auto i: film->content()) {
                auto paths = i->paths();
                for (auto j: paths) {
-                       if (!boost::filesystem::exists(j)) {
+                       if (!dcp::filesystem::exists(j)) {
                                cerr << argv[0] << ": content file " << j << " not found.\n";
                                exit (EXIT_FAILURE);
                        }
@@ -484,10 +485,13 @@ main (int argc, char* argv[])
                std::cout << UP_ONE_LINE_AND_ERASE;
 
                if (!hints.empty()) {
-                       std::cout << "Hints:\n\n";
+                       std::cerr << "Hints:\n\n";
                        for (auto hint: hints) {
-                               std::cout << word_wrap("* " + hint, 70) << "\n";
+                               std::cerr << word_wrap("* " + hint, 70) << "\n";
                        }
+                       std::cerr << "*** Encoding aborted because hints were found ***\n\n";
+                       std::cerr << "Modify your settings and run the command again, or run without\n";
+                       std::cerr << "the `--hints' option to ignore these hints and encode anyway.\n";
                        exit(EXIT_FAILURE);
                }
        }