Mercurial > paraspace
changeset 75:9422a25e798d
Pass filename from argument list for dexfile.py
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Tue, 12 Jul 2011 17:09:49 +0800 |
parents | cdc27039654c |
children | 998f2076d0bb |
files | paraspace/dexfile.py |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/paraspace/dexfile.py Tue Jul 12 12:44:56 2011 +0800 +++ b/paraspace/dexfile.py Tue Jul 12 17:09:49 2011 +0800 @@ -1649,7 +1649,15 @@ if __name__ == '__main__': - dex = DEXFile.open('data/testdata1.dex') + import sys + + if len(sys.argv) != 2: + print >> sys.stderr, 'Usage: %s <dex file>' % (sys.argv[0]) + sys.exit(1) + pass + + dex_fname = sys.argv[1] + dex = DEXFile.open(dex_fname) print 'Header' h = dex.header