From 27f9ce96db8b800b301ad3b21fb81355e982941a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 3 Mar 2025 20:52:47 +0100 Subject: Allow configuration of Grok licence via dcpomatic2_cli (#2981). --- src/lib/encode_cli.cc | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/lib/encode_cli.cc') diff --git a/src/lib/encode_cli.cc b/src/lib/encode_cli.cc index 67c82c141..7e9c25a6a 100644 --- a/src/lib/encode_cli.cc +++ b/src/lib/encode_cli.cc @@ -72,6 +72,10 @@ help(function out) out(" make-dcp make DCP from the given film; default if no other command is specified\n"); out(variant::insert_dcpomatic(" list-servers display a list of encoding servers that %1 can use (until Ctrl-C)\n")); out(" dump show a summary of the film's settings\n"); +#ifdef DCPOMATIC_GROK + out(" config-params list the parameters that can be set with `config`\n"); + out(" config set a DCP-o-matic configuration value\n"); +#endif out("\nOptions:\n\n"); out(variant::insert_dcpomatic(" -v, --version show %1 version\n")); @@ -95,6 +99,7 @@ help(function out) out(" --hints analyze film for hints before encoding and abort if any are found\n"); out("\ne.g.\n"); out(fmt::format("\n {} -t 4 make-dcp my_great_movie\n", program_name)); + out(fmt::format("\n {} config grok-licence 12345ABCD\n", program_name)); out("\n"); } @@ -374,7 +379,13 @@ encode_cli(int argc, char* argv[], function out, function commands = { "make-dcp", "list-servers", +#ifdef DCPOMATIC_GROK + "dump", + "config-params", + "config" +#else "dump" +#endif }; if (optind < argc - 1) { @@ -387,6 +398,33 @@ encode_cli(int argc, char* argv[], function out, functiongrok(); + if (parameter == "grok-licence") { + grok.licence = value; + Config::instance()->set_grok(grok); + Config::instance()->write(); + } else { + return fmt::format("Unrecognised configuration parameter `{}'", parameter); + } + } else { + return fmt::format("Missing configuration parameter: use {} config ", program_name); + } + return {}; + } +#endif + if (config) { State::override_path = *config; } -- cgit v1.2.3