Merge pull request #506 from YunoHost/list_available_users_on_app_install

[enh] list available users on app installation user argument
This commit is contained in:
Bram 2018-07-21 17:34:22 +02:00 committed by GitHub
commit 75b7a481a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -404,6 +404,7 @@
"user_unknown": "Unknown user: {user:s}",
"user_update_failed": "Unable to update user",
"user_updated": "The user has been updated",
"users_available": "Available users:",
"yunohost_already_installed": "YunoHost is already installed",
"yunohost_ca_creation_failed": "Unable to create certificate authority",
"yunohost_ca_creation_success": "The local certification authority has been created.",

View file

@ -2048,7 +2048,7 @@ def _parse_action_args_in_yunohost_format(args, action_args, auth=None):
"""
from yunohost.domain import (domain_list, _get_maindomain,
domain_url_available, _normalize_domain_path)
from yunohost.user import user_info
from yunohost.user import user_info, user_list
args_dict = OrderedDict()
@ -2094,6 +2094,11 @@ def _parse_action_args_in_yunohost_format(args, action_args, auth=None):
for domain in domain_list(auth)['domains']:
msignals.display("- {}".format(domain))
if arg_type == 'user':
msignals.display(m18n.n('users_available'))
for user in user_list(auth)['users'].keys():
msignals.display("- {}".format(user))
try:
input_string = msignals.prompt(ask_string, is_password)
except NotImplementedError: