From 0ab51209fe9b387c369219578bac1e484b0a1288 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 3 Jul 2018 20:38:23 +0200 Subject: [PATCH] [enh] list available users on app installation user argument --- locales/en.json | 1 + src/yunohost/app.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/locales/en.json b/locales/en.json index 19213c372..45b3cdb1a 100644 --- a/locales/en.json +++ b/locales/en.json @@ -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.", diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 420a5fb3e..a3f593d3e 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -2043,7 +2043,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() @@ -2085,6 +2085,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: