diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2013-07-29 19:06:53 +0200 |
---|---|---|
committer | root <root@vm-monitoring.spline.inf.fu-berlin.de> | 2013-07-29 19:06:53 +0200 |
commit | 4581b6d07f685a88fe447f187e39e8bd8a79eebc (patch) | |
tree | b836e4dd3f68c9c967e33a20e551129c8033dd9a | |
parent | f92ad5d271698c952de11e389836d496bb8dcab5 (diff) | |
download | format-notify-4581b6d07f685a88fe447f187e39e8bd8a79eebc.tar.gz format-notify-4581b6d07f685a88fe447f187e39e8bd8a79eebc.tar.bz2 format-notify-4581b6d07f685a88fe447f187e39e8bd8a79eebc.zip |
add error message if parameters are missing
-rwxr-xr-x | format-notify | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/format-notify b/format-notify index d34fe67..0356587 100755 --- a/format-notify +++ b/format-notify @@ -19,6 +19,10 @@ def clean_output(status, output): return re.sub(r'^[- :]*', '', output) def main(): + if len(sys.argv) < 4: + print('Usage: %s (PIPE|--test) SERVICE STATUS OUTPUT' % sys.argv[0]) + sys.exit(1) + file = sys.argv.pop(1) service = sys.argv.pop(1) status = sys.argv.pop(1) |