summaryrefslogtreecommitdiff
path: root/src/lib/map_cli.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-05-30 12:23:00 +0200
committerCarl Hetherington <cth@carlh.net>2023-05-30 12:23:30 +0200
commit3ef1d207f33502fa5e114924f0f9abeeda97900a (patch)
treecf4ff38f0eccbb5cd7a8de2ce565d5f7ae950087 /src/lib/map_cli.cc
parent575932b8dccb30a02e0cc140b52aede72828a69a (diff)
Add --config option to map (#2543).
Diffstat (limited to 'src/lib/map_cli.cc')
-rw-r--r--src/lib/map_cli.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/map_cli.cc b/src/lib/map_cli.cc
index 1b99afa94..c95d7f1a1 100644
--- a/src/lib/map_cli.cc
+++ b/src/lib/map_cli.cc
@@ -63,6 +63,7 @@ help(std::function<void (string)> out)
out(" -s, --soft-link using soft links instead of copying");
out(" -d, --assets-dir look in this directory for assets (can be given more than once)");
out(" -r, --rename rename all files to <uuid>.<mxf|xml>");
+ out(" --config <dir> directory containing config.xml and cinemas.xml");
}
@@ -74,6 +75,7 @@ map_cli(int argc, char* argv[], std::function<void (string)> out)
bool soft_link = false;
bool rename = false;
vector<boost::filesystem::path> assets_dir;
+ optional<boost::filesystem::path> config_dir;
/* This makes it possible to call getopt several times in the same executable, for tests */
optind = 0;
@@ -87,10 +89,11 @@ map_cli(int argc, char* argv[], std::function<void (string)> out)
{ "soft-link", no_argument, 0, 's' },
{ "assets-dir", required_argument, 0, 'd' },
{ "rename", no_argument, 0, 'r' },
+ { "config", required_argument, 0, 'c' },
{ 0, 0, 0, 0 }
};
- int c = getopt_long(argc, argv, "ho:lsd:r", long_options, &option_index);
+ int c = getopt_long(argc, argv, "ho:lsd:rc:", long_options, &option_index);
if (c == -1) {
break;
@@ -117,6 +120,9 @@ map_cli(int argc, char* argv[], std::function<void (string)> out)
case 'r':
rename = true;
break;
+ case 'c':
+ config_dir = optarg;
+ break;
}
}
@@ -127,6 +133,10 @@ map_cli(int argc, char* argv[], std::function<void (string)> out)
exit(EXIT_FAILURE);
}
+ if (config_dir) {
+ State::override_path = *config_dir;
+ }
+
vector<boost::filesystem::path> cpl_filenames;
for (int i = optind; i < argc; ++i) {
cpl_filenames.push_back(argv[i]);