From e84d5245442122ece118607d3b2bf3ccf0eacb89 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 9 Nov 2011 10:34:01 +0100 Subject: [PATCH] accept command line arguments --- client/mnemonic.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/client/mnemonic.py b/client/mnemonic.py index f1ba489b1..6a7d9f443 100644 --- a/client/mnemonic.py +++ b/client/mnemonic.py @@ -1864,15 +1864,11 @@ def mn_decode( wlist ): return out - - if __name__ == '__main__': import sys - print len(words) - key = '6a8657c1f2566290be460fd51bb9f7fc' - ss = mn_encode(key) - print key - print ss - print mn_decode(ss) - - + if len( sys.argv ) == 1: + print 'I need arguments: a hex string to encode, or a list of words to decode' + elif len( sys.argv ) == 2: + print ' '.join(mn_encode(sys.argv[1])) + else: + print mn_decode(sys.argv[1:])