Allow makedcp to report version.
authorCarl Hetherington <cth@carlh.net>
Sat, 28 Jul 2012 00:12:34 +0000 (01:12 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 28 Jul 2012 00:12:34 +0000 (01:12 +0100)
src/tools/makedcp.cc

index f4296f41c428016f784349a4b1a2c8b286e94ef0..3d9db6a3115b0aa73e3e6b824b8ded8b9a1fb122 100644 (file)
@@ -41,6 +41,7 @@ static void
 help (string n)
 {
        cerr << "Syntax: " << n << " [OPTION] <FILM>\n"
+            << "  -v, --version      show DVD-o-matic version\n"
             << "  -h, --help         show this help\n"
             << "  -d, --deps         list DVD-o-matic dependency details and quit\n"
             << "  -t, --test         run in test mode (repeatable UUID generation, timestamps etc.)\n"
@@ -59,6 +60,7 @@ main (int argc, char* argv[])
        int option_index = 0;
        while (1) {
                static struct option long_options[] = {
+                       { "version", no_argument, 0, 'v'},
                        { "help", no_argument, 0, 'h'},
                        { "deps", no_argument, 0, 'd'},
                        { "test", no_argument, 0, 't'},
@@ -73,6 +75,9 @@ main (int argc, char* argv[])
                }
 
                switch (c) {
+               case 'v':
+                       cout << "dvdomatic version " << DVDOMATIC_VERSION << "\n";
+                       exit (EXIT_SUCCESS);
                case 'h':
                        help (argv[0]);
                        exit (EXIT_SUCCESS);