Module: check_mk
Branch: master
Commit: 71f240d41106552653163588f5f205090dc540eb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=71f240d4110655…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 25 10:21:26 2011 +0100
Added small help function
---
doc/helpers/validate_checks | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/doc/helpers/validate_checks b/doc/helpers/validate_checks
index 989fcc2..7f9ade4 100755
--- a/doc/helpers/validate_checks
+++ b/doc/helpers/validate_checks
@@ -109,9 +109,12 @@ def grep_manpage(check, match, section = None):
return False
def usage(msg = ''):
- print "No real help available..."
if msg:
print msg
+ print
+ for s, l, t in _args:
+ print ' %3s, %-15s %s' % (s, l, t)
+ print
sys.exit(0)
ignored_variables = [
@@ -243,11 +246,16 @@ def verify_pnp_rra(check):
# MAIN
# #############################################################################
+_args = [
+ ('l:', 'score-limit=', 'Set an upper score limit. Only checks
with a lower score will be shown'),
+ ('v', 'verbose', 'Enable verbose output'),
+ ('h', 'help', 'Show help message'),
+]
+
_verbose = 0
_score_limit = None
try:
- opts, args = getopt.getopt(sys.argv[1:], "vhl:",
- ["verbose", "help", "score-limit="])
+ opts, args = getopt.getopt(sys.argv[1:], ''.join([ x[0] for x in _args ]), [
x[1] for x in _args ])
except getopt.error, msg:
usage(msg)
for o, a in opts: