Add -v --version command line parameters to zmaudit.pl
This commit is contained in:
parent
1adb147899
commit
71c94475ff
|
@ -69,6 +69,7 @@ delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
|
|||
my $report = 0;
|
||||
my $interactive = 0;
|
||||
my $continuous = 0;
|
||||
my $version;
|
||||
|
||||
sub usage
|
||||
{
|
||||
|
@ -78,6 +79,7 @@ Parameters are :-
|
|||
-r, --report - Just report don't actually do anything
|
||||
-i, --interactive - Ask before applying any changes
|
||||
-c, --continuous - Run continuously
|
||||
-v, --version - Print the installed version of ZoneMinder
|
||||
");
|
||||
exit( -1 );
|
||||
}
|
||||
|
@ -89,14 +91,18 @@ sub deleteSwapImage();
|
|||
logInit();
|
||||
logSetSignal();
|
||||
|
||||
if ( !GetOptions( 'report'=>\$report, 'interactive'=>\$interactive, 'continuous'=>\$continuous ) )
|
||||
if ( !GetOptions( report=>\$report, interactive=>\$interactive, continuous=>\$continuous, version=>\$version ) )
|
||||
{
|
||||
usage();
|
||||
}
|
||||
|
||||
if ( $version ) {
|
||||
print( ZoneMinder::Base::ZM_VERSION . "\n");
|
||||
exit(0);
|
||||
}
|
||||
if ( ($report + $interactive + $continuous) > 1 )
|
||||
{
|
||||
print( STDERR "Error, only option may be specified\n" );
|
||||
print( STDERR "Error, only one option may be specified\n" );
|
||||
usage();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue