add version command line argument to zmf
parent
85e51528a6
commit
258c97f75f
|
@ -99,6 +99,7 @@ void Usage()
|
||||||
fprintf( stderr, "Options:\n" );
|
fprintf( stderr, "Options:\n" );
|
||||||
fprintf( stderr, " -m, --monitor <monitor_id> : Specify which monitor to use\n" );
|
fprintf( stderr, " -m, --monitor <monitor_id> : Specify which monitor to use\n" );
|
||||||
fprintf( stderr, " -h, --help : This screen\n" );
|
fprintf( stderr, " -h, --help : This screen\n" );
|
||||||
|
fprintf( stderr, " -v, --version : Report the installed version of ZoneMinder\n" );
|
||||||
exit( 0 );
|
exit( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +114,7 @@ int main( int argc, char *argv[] )
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"monitor", 1, 0, 'm'},
|
{"monitor", 1, 0, 'm'},
|
||||||
{"help", 0, 0, 'h'},
|
{"help", 0, 0, 'h'},
|
||||||
|
{"version", 0, 0, 'v'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,7 +122,7 @@ int main( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
int option_index = 0;
|
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)
|
if (c == -1)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -135,6 +137,9 @@ int main( int argc, char *argv[] )
|
||||||
case '?':
|
case '?':
|
||||||
Usage();
|
Usage();
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
cout << ZM_VERSION << "\n";
|
||||||
|
exit(0);
|
||||||
default:
|
default:
|
||||||
//fprintf( stderr, "?? getopt returned character code 0%o ??\n", c );
|
//fprintf( stderr, "?? getopt returned character code 0%o ??\n", c );
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue