mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 03:40:07 +01:00
nmcli/connections: don't ask to ask with --ask
This is slightly annoying: $ nmcli -a c add type ethernet There is 1 optional setting for General settings. No point in asking if there's just one option. Just ask right away: $ nmcli -a c add type ethernet Interface name:
This commit is contained in:
parent
69e65a9b0e
commit
ad7ac866db
1 changed files with 7 additions and 9 deletions
|
|
@ -5696,16 +5696,14 @@ want_provide_opt_args(const NmcConfig *nmc_config, const char *type, guint num)
|
|||
{
|
||||
gs_free char *answer = NULL;
|
||||
|
||||
/* Don't ask to ask. */
|
||||
if (num == 1)
|
||||
return TRUE;
|
||||
|
||||
/* Ask for optional arguments. */
|
||||
g_print(ngettext("There is %d optional setting for %s.\n",
|
||||
"There are %d optional settings for %s.\n",
|
||||
num),
|
||||
(int) num,
|
||||
type);
|
||||
answer = nmc_readline(
|
||||
nmc_config,
|
||||
ngettext("Do you want to provide it? %s", "Do you want to provide them? %s", num),
|
||||
prompt_yes_no(TRUE, NULL));
|
||||
g_print(_("There are %d optional settings for %s.\n"), (int) num, type);
|
||||
answer =
|
||||
nmc_readline(nmc_config, _("Do you want to provide them? %s"), prompt_yes_no(TRUE, NULL));
|
||||
nm_strstrip(answer);
|
||||
return !answer || matches(answer, WORD_YES);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue