Add -v --version command line param to zmfilter.pl
This commit is contained in:
parent
94e0ec542a
commit
8ea01e631b
|
@ -115,11 +115,12 @@ delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
|
|||
my $delay = $Config{ZM_FILTER_EXECUTE_INTERVAL};
|
||||
my $event_id = 0;
|
||||
my $filter_parm = "";
|
||||
my $version = 0;
|
||||
|
||||
sub Usage
|
||||
{
|
||||
print( "
|
||||
Usage: zmfilter.pl [-f <filter name>,--filter=<filter name>]
|
||||
Usage: zmfilter.pl [-f <filter name>,--filter=<filter name>] | -v, --version
|
||||
Parameters are :-
|
||||
-f<filter name>, --filter=<filter name> - The name of a specific filter to run
|
||||
");
|
||||
|
@ -158,10 +159,14 @@ sub DateTimeToSQL
|
|||
return( strftime( "%Y-%m-%d %H:%M:%S", localtime( $dt_val ) ) );
|
||||
}
|
||||
|
||||
if ( !GetOptions( 'filter=s'=>\$filter_parm ) )
|
||||
if ( !GetOptions( 'filter=s'=>\$filter_parm, version=>\$version ) )
|
||||
{
|
||||
Usage();
|
||||
}
|
||||
if ( $version ) {
|
||||
print ZoneMinder::Base::ZM_VERSION . "\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ( ! EVENT_PATH ) {
|
||||
Error( "No event path defined. Config was $Config{ZM_DIR_EVENTS}\n" );
|
||||
|
|
Loading…
Reference in New Issue