X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=electrum;h=1e4acec36aa1c80fda88466f49021f74a007d997;hb=c329a03757556c021411c9d6e9b5cfb1e8628a2f;hp=e63803db8f954e5e949961d72d00f61acfaabac3;hpb=8997c760a2cdfdc4a78e093c143788938fa68407;p=electrum-nvc.git diff --git a/electrum b/electrum index e63803d..1e4acec 100755 --- a/electrum +++ b/electrum @@ -64,7 +64,7 @@ def prompt_password(prompt, confirm=True): def arg_parser(): usage = "%prog [options] command" - parser = optparse.OptionParser(prog=usage, add_help_option=False) + parser = optparse.OptionParser(usage=usage, add_help_option=False) parser.add_option("-h", "--help", action="callback", callback=print_help_cb, help="show this help text") parser.add_option("-g", "--gui", dest="gui", help="User interface: qt, lite, gtk, text or stdio") parser.add_option("-w", "--wallet", dest="wallet_path", help="wallet path (default: electrum.dat)") @@ -96,11 +96,13 @@ def print_help(parser): print_msg("Type 'electrum help ' to see the help for a specific command") print_msg("Type 'electrum --help' to see the list of options") run_command(known_commands['help']) - sys.exit(1) def print_help_cb(self, opt, value, parser): print_help(parser) + sys.exit(1) + + def run_command(cmd, password=None, args=None): @@ -145,6 +147,7 @@ def run_command(cmd, password=None, args=None): if __name__ == '__main__': + wallet = None parser = arg_parser() options, args = parser.parse_args() if options.portable and options.wallet_path is None: @@ -363,6 +366,7 @@ if __name__ == '__main__': elif cmd.name == 'help': if len(args) < 2: print_help(parser) + sys.exit(1) # check the number of arguments if len(args) - 1 < cmd.min_args: