From: Lennart Poettering Date: Thu, 6 Feb 2025 11:19:52 +0000 (+0100) Subject: homectl: show full list of selected groups as they are added X-Git-Tag: v258-rc1~1322^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F36271%2Fhead;p=thirdparty%2Fsystemd.git homectl: show full list of selected groups as they are added --- diff --git a/src/home/homectl.c b/src/home/homectl.c index cc2f0735827..7acaf593018 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -2549,10 +2549,19 @@ static int create_interactively(void) { return log_error_errno(r, "Failed to set userName field: %m"); _cleanup_strv_free_ char **available = NULL, **groups = NULL; - for (;;) { _cleanup_free_ char *s = NULL; + strv_sort_uniq(groups); + + if (!strv_isempty(groups)) { + _cleanup_free_ char *j = strv_join(groups, ", "); + if (!j) + return log_oom(); + + log_info("Currently selected groups: %s", j); + } + r = ask_string_full(&s, group_completion_callback, &available, "%s Please enter an auxiliary group for user %s (empty to continue, \"list\" to list available groups): ",