]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
bin/notify.py: Check for invalid arguments.
authorSimon Ruderich <simon@ruderich.org>
Tue, 3 Sep 2013 01:12:51 +0000 (03:12 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 3 Sep 2013 01:14:10 +0000 (03:14 +0200)
bin/notify.py

index 42fe6618eeedae78d00561ab8a31d78848726602..3caa7d2a70ede6e931d5b535dc3c02f6bce00405 100755 (executable)
@@ -35,6 +35,10 @@ def mouse_press_callback(widget, event):
 
 
 if __name__ == '__main__':
+    if len(sys.argv) != 2:
+        sys.stderr.write("Usage: %s <message>\n" % (sys.argv[0]))
+        sys.exit(1)
+
     # Display configuration.
     BOLD     = True
     FG_COLOR = 'blue'