- bail out if either file does not exist
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thu, 5 Apr 2007 12:27:12 +0000 (12:27 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thu, 5 Apr 2007 12:27:12 +0000 (12:27 -0000)
  Avoids filling my scrollback-buffer with superfluous information ;)

scripts/bloat-o-meter

index 67b3d290d7397d83aeef510d12987dec796c880d..f6608afb85b088a309203eeaaa445bbad4e429f9 100755 (executable)
@@ -13,6 +13,11 @@ if len(sys.argv) != 3:
     sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0])
     sys.exit(-1)
 
+for f in sys.argv[1], sys.argv[2]:
+    if not os.path.exists(f):
+        sys.stderr.write("Error: file '%s' does not exist\n" % f)
+        sys.exit(-1)
+
 def getsizes(file):
     sym = {}
     for l in os.popen("nm --size-sort " + file).readlines():