Add --config option to dcpomatic2 (#1703).
authorCarl Hetherington <cth@carlh.net>
Fri, 27 Dec 2019 22:40:18 +0000 (23:40 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 27 Dec 2019 22:40:18 +0000 (23:40 +0100)
src/tools/dcpomatic.cc

index cce7c369be8b9966e563c90ff538392abfcf1130..68bf20732a0685d79b3e44800a4003c921522093 100644 (file)
@@ -1488,6 +1488,7 @@ static const wxCmdLineEntryDesc command_line_description[] = {
        { wxCMD_LINE_OPTION, "c", "content", "add content file / directory", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_OPTION, "d", "dcp", "add content DCP", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_SWITCH, "v", "version", "show DCP-o-matic version", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
+       { wxCMD_LINE_OPTION, "", "config", "directory containing config.xml and cinemas.xml", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_PARAM, 0, 0, "film to load or create", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 }
 };
@@ -1653,6 +1654,11 @@ private:
                        _dcp_to_add = wx_to_std (dcp);
                }
 
+               wxString config;
+               if (parser.Found (wxT("config"), &config)) {
+                       State::override_path = wx_to_std (config);
+               }
+
                return true;
        }