From adc4078b8743a1437d44557dafea8619b1ce0fb1 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Wed, 20 Aug 2008 22:08:11 +0200 Subject: split yesno() into yesno() and noyes() functions. The yesno function had a preset argument for specifying the default answer : yes or no. However, in all our calls to yesno, only one used the default "no" answer. Having to specify preset==1 for all the other cases was rather cumbersome. To make this easier, this commit adds a noyes function, with the following behavior : yesno() : default answer is yes noyes() : default answer is no Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- src/pacman/remove.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pacman/remove.c') diff --git a/src/pacman/remove.c b/src/pacman/remove.c index f091fa4d..b70f7035 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -75,10 +75,10 @@ int pacman_remove(alpm_list_t *targets) } printf(_(":: group %s:\n"), targ); list_display(" ", pkgnames); - int all = yesno(1, _(" Remove whole content?")); + int all = yesno(_(" Remove whole content?")); for(p = pkgnames; p; p = alpm_list_next(p)) { char *pkgn = alpm_list_getdata(p); - if(all || yesno(1, _(":: Remove %s from group %s?"), pkgn, targ)) { + if(all || yesno(_(":: Remove %s from group %s?"), pkgn, targ)) { if(alpm_trans_addtarget(pkgn) == -1) { pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", targ, alpm_strerrorlast()); @@ -131,7 +131,7 @@ int pacman_remove(alpm_list_t *targets) printf("\n"); /* get confirmation */ - if(yesno(1, _("Do you want to remove these packages?")) == 0) { + if(yesno(_("Do you want to remove these packages?")) == 0) { retval = 1; goto cleanup; } -- cgit v1.2.3