diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-12-30 22:48:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-09 02:03:53 +0100 |
| commit | 9165e4baacbb6dbeb5aa7f1c1abb3254f3aebcfe (patch) | |
| tree | bfb9ee8ceed13fb05d133a944122d25f0dd33c5e | |
| parent | 99abebca58819185b7ef7254a436d6192aa714bd (diff) | |
Add some context to command-line verifier on --context.2908-verify-details
| -rw-r--r-- | tools/dcpverify.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tools/dcpverify.cc b/tools/dcpverify.cc index 7eca11f1..e9269a5d 100644 --- a/tools/dcpverify.cc +++ b/tools/dcpverify.cc @@ -50,6 +50,7 @@ using std::cerr; using std::cout; using std::list; +using std::map; using std::string; using std::vector; using boost::bind; @@ -70,7 +71,8 @@ help (string n) << " --no-asset-hash-check don't check asset hashes\n" << " --asset-hash-check-maximum-size <size-in-MB> only check hashes for assets smaller than this size (in MB)\n" << " -o <filename> write HTML report to filename\n" - << " -q, --quiet don't report progress\n"; + << " -q, --quiet don't report progress\n" + << " -c, --context give more context for errors and warnings\n"; } @@ -83,6 +85,7 @@ main (int argc, char* argv[]) bool ignore_bv21_smpte = false; bool quiet = false; boost::optional<boost::filesystem::path> report_filename; + bool context = false; dcp::VerificationOptions verification_options; @@ -96,10 +99,11 @@ main (int argc, char* argv[]) { "no-asset-hash-check", no_argument, 0, 'C' }, { "asset-hash-check-maximum-size", required_argument, 0, 'D' }, { "quiet", no_argument, 0, 'q' }, + { "context", no_argument, 0, 'c' }, { 0, 0, 0, 0 } }; - int c = getopt_long (argc, argv, "VhABCD:qo:", long_options, &option_index); + int c = getopt_long (argc, argv, "VhABCD:qo:c", long_options, &option_index); if (c == -1) { break; @@ -132,6 +136,9 @@ main (int argc, char* argv[]) case 'o': report_filename = optarg; break; + case 'c': + context = true; + break; } } @@ -201,18 +208,24 @@ main (int argc, char* argv[]) case dcp::VerificationNote::Type::OK: break; case dcp::VerificationNote::Type::ERROR: - cout << "Error: " << note_to_string(i) << "\n"; + cout << "Error: " << message << "\n"; failed = true; break; case dcp::VerificationNote::Type::BV21_ERROR: - cout << "Bv2.1 error: " << note_to_string(i) << "\n"; + cout << "Bv2.1 error: " << message << "\n"; bv21_failed = true; break; case dcp::VerificationNote::Type::WARNING: - cout << "Warning: " << note_to_string(i) << "\n"; + cout << "Warning: " << message << "\n"; warned = true; break; } + + if (context) { + for (auto iter: context_values) { + std::cout << " " << iter.first << ": " << iter.second << "\n"; + } + } } if (!failed && !quiet) { |
