cmd = 'gui'
else:
cmd = args[0]
- firstarg = args[1] if len(args) > 1 else ''
if cmd == 'gui':
elif cmd == 'createrawtransaction':
args = [ cmd, json.loads(args[1]), json.loads(args[2])]
- elif cmd=='listaddresses':
+ elif cmd == 'listaddresses':
args = [cmd, options.show_all, options.show_balance, options.show_labels]
elif cmd in ['payto', 'mktx']:
args = [ 'mktx', args[1], Decimal(args[2]), Decimal(options.tx_fee) if options.tx_fee else None, options.change_addr, options.from_addr ]
+ elif cmd == 'help':
+ if len(args) < 2:
+ parser.print_help()
+ print_msg("Type 'electrum help <command>' to see the help for a specific command")
+ print_msg("Type 'electrum --help' to see the list of options")
+
-
-
# open session
if cmd not in offline_commands and not options.offline:
interface = Interface(config)
# run the command
- if cmd == 'help':
- cmd2 = firstarg
- if cmd2 not in known_commands:
- parser.print_help()
- print_msg("Type 'electrum help <command>' to see the help for a specific command")
- print_msg("Type 'electrum --help' to see the list of options")
- print_msg("List of commands:", ', '.join(known_commands))
- else:
- _, _, description, syntax, options_syntax = known_commands[cmd2]
- print_msg(description)
- if syntax: print_msg("Syntax: " + syntax)
- if options_syntax: print_msg("options:\n" + options_syntax)
- elif cmd == 'deseed':
+ if cmd == 'deseed':
if not wallet.seed:
print_msg("Error: This wallet has no seed")
else:
else:
print_msg(False)
-
elif cmd == 'password':
new_password = prompt_password('New password:')
wallet.update_password(seed, password, new_password)
-
-
else:
cmd_runner = Commands(wallet, interface)
func = eval('cmd_runner.' + cmd)
if type(result) == str:
util.print_msg(result)
- else:
+ elif result is not None:
util.print_json(result)
out.append( item )
return out
+ def help(self, cmd2=None):
+ if cmd2 not in known_commands:
+ print_msg("List of commands:", ', '.join(known_commands))
+ else:
+ _, _, description, syntax, options_syntax = known_commands[cmd2]
+ print_msg(description)
+ if syntax: print_msg("Syntax: " + syntax)
+ if options_syntax: print_msg("options:\n" + options_syntax)
+ return None
+