about summary refs log tree commit diff stats
path: root/example/disas_and_graph.py
diff options
context:
space:
mode:
Diffstat (limited to 'example/disas_and_graph.py')
-rwxr-xr-xexample/disas_and_graph.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py
index 6f505df3..268af176 100755
--- a/example/disas_and_graph.py
+++ b/example/disas_and_graph.py
@@ -20,13 +20,7 @@ except ImportError:
 import pickle
 import sys
 
-
-
-
-print sys.argv
-
-
-parser = OptionParser()
+parser = OptionParser(usage = "usage: %prog [options] file")
 parser.add_option('-a', "--address", dest="address", metavar="ADDRESS",
                   help="address to disasemble")
 parser.add_option('-m', "--architecture", dest="machine",metavar="MACHINE",
@@ -39,8 +33,9 @@ parser.add_option('-r', "--rawfile", dest="rawfile", action="store_true",
                   help="dont use PE/ELF/CLASS autodetect, disasm raw file")
 
 (options, args) = parser.parse_args(sys.argv[1:])
-print options, args
-
+if not args:
+    parser.print_help()
+    sys.exit(0)
 fname = args[0]
 ad_to_dis = options.address