parser.add_option("-W", "--password", dest="password", default=None, help="set password for usage with commands (currently only implemented for create command, do not use it for longrunning gui session since the password is visible in /proc)")
return parser
return parser
def print_help(parser):
def print_help(parser):
@ -185,22 +186,22 @@ if __name__ == '__main__':
if cmd in ['create', 'restore']:
if cmd in ['create', 'restore']:
if wallet.storage.file_exists:
if wallet.storage.file_exists:
sys.exit("Error: Remove the existing wallet first!")
sys.exit("Error: Remove the existing wallet first!")
password = prompt_password("Password (hit return if you do not wish to encrypt your wallet):")
if options.password != None:
password = options.password
server = config.get('server')
else:
if not server: server = pick_random_server()
password = prompt_password("Password (hit return if you do not wish to encrypt your wallet):")
w_host, w_port, w_protocol = server.split(':')
host = raw_input("server (default:%s):"%w_host)
# if config.server is set, the user either passed the server on command line
port = raw_input("port (default:%s):"%w_port)
# or chose it previously already. if he didn't pass a server on the command line,