diff --git a/src/zma.cpp b/src/zma.cpp index 117ada241..cb6ddb4e8 100644 --- a/src/zma.cpp +++ b/src/zma.cpp @@ -31,6 +31,7 @@ void Usage() fprintf( stderr, "Options:\n" ); fprintf( stderr, " -m, --monitor : Specify which monitor to use\n" ); fprintf( stderr, " -h, --help : This screen\n" ); + fprintf( stderr, " -v, --version : Report the installed version of ZoneMinder\n" ); exit( 0 ); } @@ -45,6 +46,7 @@ int main( int argc, char *argv[] ) static struct option long_options[] = { {"monitor", 1, 0, 'm'}, {"help", 0, 0, 'h'}, + {"version", 0, 0, 'v'}, {0, 0, 0, 0} }; @@ -52,7 +54,7 @@ int main( int argc, char *argv[] ) { int option_index = 0; - int c = getopt_long (argc, argv, "m:h", long_options, &option_index); + int c = getopt_long (argc, argv, "m:h:v", long_options, &option_index); if (c == -1) { break; @@ -67,6 +69,9 @@ int main( int argc, char *argv[] ) case '?': Usage(); break; + case 'v': + cout << ZM_VERSION << "\n"; + exit(0); default: //fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); break;