diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-12-22 14:30:30 +0100 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-12-26 14:55:38 +0100 |
commit | 62a27eb9596ed597b85b6c215be77ca5db4807d9 (patch) | |
tree | 357662fc9f564465f04c6b39fd05621f6e98d45a | |
parent | adbfb65946b1225b6412858fa98c28223bb9bd0f (diff) |
[feat] allow --pass on auth too, for tests
undocumented because we don't want users messing with the option
-rw-r--r-- | src/leap/bitmask/cli/user.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/leap/bitmask/cli/user.py b/src/leap/bitmask/cli/user.py index d13d417..b802d86 100644 --- a/src/leap/bitmask/cli/user.py +++ b/src/leap/bitmask/cli/user.py @@ -83,8 +83,15 @@ SUBCOMMANDS: return self._send(printer=command.default_dict_printer) def auth(self, raw_args): + passwd = None + for (index, item) in enumerate(raw_args): + if item.startswith('--pass'): + passwd = raw_args.pop(index + 1) + raw_args.pop(index) + username = self.username(raw_args) - passwd = getpass.getpass() + if not passwd: + passwd = getpass.getpass() self.data += ['authenticate', username, passwd, 'true'] return self._send(printer=command.default_dict_printer) |