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:53 +0000 (22:40 +0000)
src/tools/dcpomatic.cc

index 01a600282d58a86cb6d5a513f792863b624a3f6b..4edfe4cd1b997afd916a9c6e81c10fdde8123f75 100644 (file)
@@ -1445,6 +1445,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 }
 };
@@ -1601,6 +1602,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;
        }