diff --git a/electrum b/electrum index b6f825aa8..b2d6632cd 100755 --- a/electrum +++ b/electrum @@ -87,7 +87,7 @@ from electrum.commands import get_parser, known_commands, Commands, config_varia # get password routine def prompt_password(prompt, confirm=True): import getpass - password = getpass.getpass(prompt) + password = getpass.getpass(prompt, stream=None) if password and confirm: password2 = getpass.getpass("Confirm: ") if password != password2: @@ -141,8 +141,7 @@ def init_cmdline(config): return prompt_password("Password (hit return if you do not wish to encrypt your wallet):") if cmd.name == 'restore': - import getpass - text = getpass.getpass(prompt="seed:", stream=None) if config.get('concealed') else raw_input("seed or key(s):") + text = config.get('text') try: wallet = Wallet.from_text(text, password_dialog, storage) except BaseException as e: @@ -425,6 +424,8 @@ if __name__ == '__main__': else: raise BaseException('Cannot get argument from stdin') elif arg == '?': + sys.argv[i] = raw_input("Enter argument:") + elif arg == ':': sys.argv[i] = prompt_password('Enter argument (will not echo):', False) # parse command line diff --git a/lib/commands.py b/lib/commands.py index 180aa4f78..db9b5201c 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -103,10 +103,11 @@ class Commands: """Create a new wallet""" @command('') - def restore(self, concealed=False): - """Restore a wallet. A wallet can be restored from a seed phrase, a - master public key, a master private key, a list of bitcoin addresses - or bitcoin private keys.""" + def restore(self, text): + """Restore a wallet from text. Text can be a seed phrase, a master + public key, a master private key, a list of bitcoin addresses + or bitcoin private keys. If you want to be prompted for your + seed, type '?' or ':' (concealed) """ @command('w') def deseed(self): @@ -615,7 +616,6 @@ param_descriptions = { command_options = { 'password': ("-W", "--password", "Password"), - 'concealed': ("-C", "--concealed", "Don't echo seed to console when restoring"), 'receiving': (None, "--receiving", "Show only receiving addresses"), 'change': (None, "--change", "Show only change addresses"), 'frozen': (None, "--frozen", "Show only frozen addresses"),