Add --version option to main DCP-o-matic.
authorCarl Hetherington <cth@carlh.net>
Fri, 27 Dec 2019 22:16:05 +0000 (23:16 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 27 Dec 2019 22:16:05 +0000 (23:16 +0100)
src/tools/dcpomatic.cc

index a8930f81fed9566f00f10b208ab4e16fb0c62ec2..cce7c369be8b9966e563c90ff538392abfcf1130 100644 (file)
@@ -1487,6 +1487,7 @@ static const wxCmdLineEntryDesc command_line_description[] = {
        { wxCMD_LINE_SWITCH, "n", "new", "create new film", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
        { 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_PARAM, 0, 0, "film to load or create", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 }
 };
@@ -1629,6 +1630,11 @@ private:
 
        bool OnCmdLineParsed (wxCmdLineParser& parser)
        {
+               if (parser.Found (wxT("version"))) {
+                       cout << "dcpomatic version " << dcpomatic_version << " " << dcpomatic_git_commit << "\n";
+                       exit (EXIT_SUCCESS);
+               }
+
                if (parser.GetParamCount() > 0) {
                        if (parser.Found (wxT ("new"))) {
                                _film_to_create = wx_to_std (parser.GetParam (0));