[icinga-checkins] icinga.org: icinga-core/fholzer/core: add -h|--help Option with Usage Output

git at icinga.org git at icinga.org
Wed Apr 25 15:12:12 CEST 2012


Module: icinga-core
Branch: fholzer/core
Commit: 46b9a3b28ded30d862c67bbd8dcec119ee340a17
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=46b9a3b28ded30d862c67bbd8dcec119ee340a17

Author: Franz Holzer <office at frankstar.at>
Date:   Wed Apr 25 15:12:18 2012 +0200

add -h|--help Option with Usage Output

---

 tools/icinga_verification.pl |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/tools/icinga_verification.pl b/tools/icinga_verification.pl
index e777a3c..0c5cb28 100644
--- a/tools/icinga_verification.pl
+++ b/tools/icinga_verification.pl
@@ -55,8 +55,19 @@ my $config_ref = {
 # Option parsing
 ################################
 
-my ($verbose, $reporting, $sanitycheck, $issuereport) = ''; 
-my $result = GetOptions( "verbose" => \$verbose, "reporting" => \$reporting, "sanitycheck" => \$sanitycheck, "issuereport" => \$issuereport);
+my ($verbose, $reporting, $sanitycheck, $issuereport, $help) = ''; 
+my $result = GetOptions( 
+					"verbose" => \$verbose, 
+					"reporting" => \$reporting, 
+					"sanitycheck" => \$sanitycheck, 
+					"issuereport" => \$issuereport,
+					"help" => \$help
+					);
+
+if ($help){
+	usage();
+	exit;
+}
 
 ################################
 # Script Config
@@ -618,3 +629,18 @@ sub get_error_from_log ($$) {
         print STDERR "Could not open logfile $file: $!\n";
     }
 }
+
+sub usage{
+print <<EOF;
+
+icinga_verification -r|--reporting=[Shows the Verbose Reporting Output]
+                    -s|--sanitycheck=[Shows the Sanity Checks]
+                    -i|--issuereport=[Shows a Issue Tracker prepared Output]
+		    no option=[Shows only the Verbose Reporting Output]
+
+This script will check certain settings/entries of your OS environ-
+ment and Icinga Config to assist you in finding problems when you 
+are using Icinga. 
+
+EOF
+}
\ No newline at end of file





More information about the icinga-checkins mailing list