/* Copyright (C) 2013-2022 Carl Hetherington This file is part of DCP-o-matic. DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with DCP-o-matic. If not, see . */ /** @file src/tools/dcpomatic_kdm_cli.cc * @brief Command-line program to generate KDMs. */ #include "cinema.h" #include "cinema_list.h" #include "cross.h" #include "config.h" #include "dkdm_wrapper.h" #include "email.h" #include "exceptions.h" #include "film.h" #include "kdm_with_metadata.h" #include "screen.h" #include "variant.h" #include #include #include #include #include #include using std::dynamic_pointer_cast; using std::list; using std::make_shared; using std::pair; using std::runtime_error; using std::shared_ptr; using std::string; using std::vector; using boost::optional; using boost::bind; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif using namespace dcpomatic; static void help (std::function out) { out (String::compose("Syntax: %1 [OPTION] [COMMAND] ", program_name)); out ("Commands:"); out ("create create KDMs; default if no other command is specified"); out (variant::insert_dcpomatic("list-cinemas list known cinemas from %1 settings")); out (variant::insert_dcpomatic("list-dkdm-cpls list CPLs for which %1 has DKDMs")); out (variant::insert_dcpomatic("add-dkdm add DKDM to %1's list")); out (variant::insert_dcpomatic("dump-decryption-certificate write the %1 KDM decryption certificate to the console")); out (" -h, --help show this help"); out (" -o, --output output file or directory"); out (" -K, --filename-format filename format for KDMs"); out (" -Z, --container-name-format filename format for ZIP containers"); out (" -f, --valid-from