From c3d85180150f13c948fee40c007c4d8130f4bef4 Mon Sep 17 00:00:00 2001
From: Mitchel Humpherys <mitchelh@codeaurora.org>
Date: Mon, 21 Apr 2014 15:00:34 -0700
Subject: [PATCH] lrdp-v2: improve error message when !vmlinux && !autodumpdir

Currently, if the user doesn't specify a vmlinux image or an
autodumpdir (like when running ramparse.py with absolutely no arguments)
they get a big ugly python stacktrace and no helpful error message. Fix
this.

Change-Id: I2d5aaaae5c8afd651ef48cfbd8f974227c2032fe
---
 linux-ramdump-parser-v2/ramparse.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-ramdump-parser-v2/ramparse.py b/linux-ramdump-parser-v2/ramparse.py
index a2181ab..859308d 100755
--- a/linux-ramdump-parser-v2/ramparse.py
+++ b/linux-ramdump-parser-v2/ramparse.py
@@ -128,6 +128,10 @@ if __name__ == '__main__':
             sys.exit(1)
 
     if options.vmlinux is None:
+        if options.autodump is None:
+            print_out_str("No vmlinux or autodump dir given. I can't proceed!")
+            parser.print_usage()
+            sys.exit(1)
         autovm = os.path.join(options.autodump, 'vmlinux')
         if os.path.isfile(autovm):
             options.vmlinux = autovm
-- 
GitLab