about summary refs log tree commit diff stats
path: root/example/disas_and_graph.py
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2011-10-03 09:22:24 +0200
committerserpilliere <devnull@localhost>2011-10-03 09:22:24 +0200
commit0f8d9874345d4ceae672e6c794a1071d880b5f69 (patch)
tree49fd4564d647c6821f4a116ed4ae4df4c6c8a830 /example/disas_and_graph.py
parent18902bb5f758e9c6a1b183f0b4a4f08c3d825f5f (diff)
downloadmiasm-0f8d9874345d4ceae672e6c794a1071d880b5f69.tar.gz
miasm-0f8d9874345d4ceae672e6c794a1071d880b5f69.zip
rem EQ token
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