summaryrefslogtreecommitdiff
path: root/src/lib/encode_cli.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-03 00:17:27 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-08 00:12:07 +0100
commit09471c55b24d5e69359675fe669397f031aa62d3 (patch)
tree5f552b95c15652417342a5c0e0dbc78fb240c186 /src/lib/encode_cli.cc
parent3be10e6264ee8a817c4b6ed744a2a34cf99cecea (diff)
Preparation for offering command in the encode CLI.
Diffstat (limited to 'src/lib/encode_cli.cc')
-rw-r--r--src/lib/encode_cli.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/encode_cli.cc b/src/lib/encode_cli.cc
index d7c4541cb..c321d5014 100644
--- a/src/lib/encode_cli.cc
+++ b/src/lib/encode_cli.cc
@@ -66,7 +66,9 @@ using boost::optional;
static void
help(function <void (string)> out)
{
- out(fmt::format("Syntax: {} [OPTION] [<FILM>]\n", program_name));
+ out(fmt::format("Syntax: {} [OPTION] [COMMAND] [<FILM>]\n", program_name));
+ out("Commands:\n");
+ out("make-dcp make DCP from the given film; default if no other command is specified\n");
out(variant::insert_dcpomatic(" -v, --version show %1 version\n"));
out(" -h, --help show this help\n");
out(" -f, --flags show flags passed to C++ compiler on build\n");
@@ -270,6 +272,7 @@ encode_cli(int argc, char* argv[], function<void (string)> out, function<void ()
optional<string> export_format;
optional<boost::filesystem::path> export_filename;
bool hints = false;
+ string command = "make-dcp";
/* This makes it possible to call getopt several times in the same executable, for tests */
optind = 0;
@@ -360,6 +363,11 @@ encode_cli(int argc, char* argv[], function<void (string)> out, function<void ()
}
}
+ if (optind < argc - 1) {
+ /* Command with a film specified afterwards */
+ command = argv[optind++];
+ }
+
if (config) {
State::override_path = *config;
}