diff options
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/bitmask/cli/user.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/leap/bitmask/cli/user.py b/src/leap/bitmask/cli/user.py index d45d503..d13d417 100644 --- a/src/leap/bitmask/cli/user.py +++ b/src/leap/bitmask/cli/user.py @@ -52,6 +52,13 @@ SUBCOMMANDS: def create(self, raw_args): args = tuple([command.appname] + sys.argv[1:4]) + passwd = None + + for (index, item) in enumerate(raw_args): + if item.startswith('--pass'): + passwd = raw_args.pop(index + 1) + raw_args.pop(index) + parser = argparse.ArgumentParser( description='Bitmask user', prog='%s %s %s %s' % args) @@ -69,7 +76,8 @@ SUBCOMMANDS: args.pop(index) username = self.username(args) - passwd = self._getpass_twice() + if not passwd: + passwd = self._getpass_twice() self.data += ['create', username, passwd, subargs.invite, 'true'] return self._send(printer=command.default_dict_printer) @@ -129,6 +137,7 @@ SUBCOMMANDS: color = Fore.GREEN print(color + u['userid'] + Fore.RESET) + _username_kw = { 'nargs': '?', 'help': 'username ID, in the form <user@example.org>'} |